| public String toString(Charset charset) Overrides java.io.ByteArrayOutputStream.toString.
Doc from java.io.ByteArrayOutputStream.toString.
Converts the buffer's contents into a string by decoding the bytes using
the specified charset. The length of the new
String is a function of the charset, and hence may not be equal
to the length of the byte array.
This method always replaces malformed-input and unmappable-character
sequences with the charset's default replacement string. The java.nio.charset.CharsetDecoder class should be used when more control
over the decoding process is required.
- Parameters
- charset:Charset
the charset
to be used to decode the bytes
- Returns:String
String decoded from the buffer's contents.
|