This class implements an output stream in which the data is
written into a byte array. The buffer automatically grows as data
is written to it.
The data can be retrieved using toByteArray() and
Resets the count field of this byte array output
stream to zero, so that all currently accumulated output in the
ouput stream is discarded. The output stream can be used again,
reusing the already allocated buffer space.
Note: toString() is deprecated.This method does not properly convert bytes into characters.
As of JDK 1.1, the preferred way to do this is via the
toString(String enc) method, which takes an encoding-name
argument, or the toString() method, which uses the
platform's default character encoding.
Creates a newly allocated string. Its size is the current size of
the output stream and the valid contents of the buffer have been
copied into it. Each character c in the resulting string is
constructed from the corresponding element b in the byte
array such that:
c == (char)(((hibyte & 0xff) << 8) | (b & 0xff))
hibyte - the high byte of each resulting Unicode character.
the current contents of the output stream, as a string.
Submit a bug or feature - Version 1.1.8 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1995-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.