Fields
| Name | Description |
|---|---|
| buf | The buffer where data is stored. |
| count | The number of valid bytes in the buffer. |
Constructors
| Name | Description |
|---|---|
| ByteArrayOutputStream() | Creates a new byte array output stream. |
| ByteArrayOutputStream(int) | Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes. |
Methods
| Name | Description |
|---|---|
| reset() | Resets the count field of this byte array output stream to zero, so that all currently accumulated output in the ouput stream is discarded. |
| size() | Returns the current size of the buffer. |
| toByteArray() | Creates a newly allocated byte array. |
| toString() | Converts the buffer's contents into a string, translating bytes into characters according to the platform's default character encoding. |
| toString(int) | Creates a newly allocated string. Deprecated. |
| toString(String) | Converts the buffer's contents into a string, translating bytes into characters according to the specified character encoding. |
| write(byte[], int, int) | Writes len bytes from the specified byte array starting at offset off to this byte array output stream. |
| write(int) | Writes the specified byte to this byte array output stream. |
| writeTo(OutputStream) | 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 out.write(buf, 0, count). |