public interface IByteArrayOutputStream extends IOutputStream
ByteArrayOutputStream-representing interface to be used in API contracts.
IOutputStream for further details.
|Modifier and Type||Method and Description|
Returns the current size of the buffer.
Creates a newly allocated byte array.
Converts the buffer's contents into a string by decoding the bytes using the named
Writes the complete contents of this byte array output stream to the specified output stream argument, as if by calling the output stream's write method using
void writeTo(IOutputStream out) throws IOException
out.write(buf, 0, count).
out- the output stream to which to write the data.
IOException- if an I/O error occurs.
countfield of this byte array output stream to zero, so that all currently accumulated output in the output stream is discarded. The output stream can be used again, reusing the already allocated buffer space.
countfield, which is the number of valid bytes in this output stream.
String toString(String charsetName) throws UnsupportedEncodingException
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 this charset's default replacement string. The
CharsetDecoder class should be used when more control
over the decoding process is required.
Copyright © 2013–2018. All rights reserved.