This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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
It's not a secret anymore!