Sunday, 10 March 2013

writeUTF(String)


writeUTF(String)

Declaration:
public final void writeUTF(java.lang.String str)
throws IOException
Description:
Writes a string to the underlying output stream using UTF-8 encoding in a machine-independent manner.
First, two bytes are written to the output stream as if by the writeShort method giving the number of
bytes to follow. This value is the number of bytes actually written out, not the length of the string.
Following the length, each character of the string is output, in sequence, using the UTF-8 encoding for the
character.

Parameters:
str - a string to be written.
Throws:
IOException - if an I/O error occurs.

No comments:

Post a Comment