Class prominence.io.ResetByteArrayOutputStream
All Packages Class Hierarchy This Package Previous Next Index
Class prominence.io.ResetByteArrayOutputStream
java.lang.Object
|
+----java.io.OutputStream
|
+----java.io.ByteArrayOutputStream
|
+----prominence.io.ResetByteArrayOutputStream
- public class ResetByteArrayOutputStream
- extends ByteArrayOutputStream
A ByteArrayOutputStream that automatically resets after
any operation that extracts the buffer contents.
-
ResetByteArrayOutputStream()
- Creates a new ResetByteArrayOutputStream with the
default initial buffer size.
-
ResetByteArrayOutputStream(int)
- Creates a new ResetByteArrayOutputStream with a
specified initial buffer size.
-
toByteArray()
- Extracts the contents of the buffer as an array of bytes, and
then resets the internal buffer.
-
writeTo(OutputStream)
- Writes the contents of the buffer to a specified OutputStream
and then resets the internal buffer.
ResetByteArrayOutputStream
public ResetByteArrayOutputStream()
- Creates a new ResetByteArrayOutputStream with the
default initial buffer size.
ResetByteArrayOutputStream
public ResetByteArrayOutputStream(int size)
- Creates a new ResetByteArrayOutputStream with a
specified initial buffer size.
- Parameters:
- size - The initial buffer size
toByteArray
public byte[] toByteArray()
- Extracts the contents of the buffer as an array of bytes, and
then resets the internal buffer.
- Returns:
- A copy of the buffer contents.
- Overrides:
- toByteArray in class ByteArrayOutputStream
- See Also:
- toString
writeTo
public void writeTo(OutputStream out) throws IOException
- Writes the contents of the buffer to a specified OutputStream
and then resets the internal buffer.
- Parameters:
- out - The OutputStream to which the buffer should be written
- Throws: IOException
- Occurs if there is a problem writing the buffer
to the stream.
- Overrides:
- writeTo in class ByteArrayOutputStream
All Packages Class Hierarchy This Package Previous Next Index