java.io.ByteArrayOutputStream (class)
Constructors:
ByteArrayOutputStream();
ByteArrayOutputStream(int size);
General Description: The class allows you to stream data into an array of bytes. Classes like DatagramSocket only work with blocks of data; this class takes the role of streaming information.
Parent Class: InputStream
Methods
void reset(); Clear buffers and empties array.
int write(byte[] arr, int offset, int len); Write an array of bytes (arr) beginning at offset for len bytes.
byte[] toByteArray(); Returns the array of streamed data.
int size(); Return the current size of the buffer.
String toString(String encoder); Create string, translating chars with encoder.
void write(int b); Write a single byte to the stream.
void write(OutputStream o); Send the array of data through the OutputStream.
Exceptions Thrown
(none),