ByteArrayOutputStream.toString
Class Overview | Class Members |
This Package |
All Packages
public String toString()
Description
Converts the buffer's contents into a string, translating bytes into
characters according to the platform's default character encoding.
Overrides
toString in class Object
public String toString( String enc ) throws UnsupportedEncodingException
Parameters
- enc
- a character-encoding name.
Description
Converts the buffer's contents into a string, translating bytes into
characters according to the specified character encoding.
public String toString( int hibyte )
Parameters
- hibyte
- the high byte of each resulting Unicode character.
Returns
the current contents of the output stream, as a string.
Description
Note: toString() is deprecated.
This method does not properly convert bytes into characters.
As of JDK 1.1, the preferred way to do this is via the
toString(String enc) method, which takes an encoding-name
argument, or the toString() method, which uses the
platform's default character encoding.
Creates a newly allocated string. Its size is the current size of
the output stream and the valid contents of the buffer have been
copied into it. Each character c in the resulting string is
constructed from the corresponding element b in the byte
array such that:
c == (char)(((hibyte & 0xff) << 8) | (b & 0xff))
See Also
size, toString, toString