File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes dataOutputStream.write Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "dataOutputStream.write" Watch "dataOutputStream.write" New topic


Robert Kennedy
Ranch Hand

Joined: Jun 27, 2008
Posts: 63
I am writing on a socket.

If the bytes in buffer and less than the bufferSize is additional overhead incurred?

dataOutputStream.write(buffer, 0, bufferSize);
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 691
Could you reenter your question? It doesn't make sense as worded.

write will output buffersize bytes in buffer starting at the first (0) byte.
buffersize must be <= the buffer length
I agree. Here's the link:
subject: dataOutputStream.write
jQuery in Action, 3rd edition