java.io.ByteArrayOutputStream (JDK 1.0)
This class is a subclass of OutputStream in which data that are written are stored in an internal byte array. The internal array grows as necessary, and can be retrieved with toByteArray() or toString(). The reset() method discards any data currently stored in the internal array and begins storing data from the beginning again. See also CharArrayWriter.
public classByteArrayOutputStreamextends OutputStream { //Public ConstructorspublicByteArrayOutputStream(); publicByteArrayOutputStream(intsize); //Protected Instance Variablesprotected byte[]buf; protected intcount; //Public Instance Methodspublic synchronized voidreset(); public intsize(); public synchronized byte[]toByteArray(); public StringtoString(); //Overrides Object1.1 public StringtoString(Stringenc) throws UnsupportedEncodingException; # public StringtoString(inthibyte); public synchronized voidwrite(intb); //Defines OutputStreampublic synchronized voidwrite(byte[]b, intoff, intlen); //Overrides OutputStreampublic synchronized voidwriteTo(OutputStreamout) throws IOException; }
Hierarchy:
Object->OutputStream->ByteArrayOutputStream