Java java.io ByteArrayOutputStream fields, constructors, methods, implement or subclass

Example usage for Java java.io ByteArrayOutputStream fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.io ByteArrayOutputStream.

The text is from its open source code.

Subclass

java.io.ByteArrayOutputStream has subclasses.
Click this link to see all its subclasses.

Constructor

ByteArrayOutputStream()
Creates a new ByteArrayOutputStream .
ByteArrayOutputStream(int size)
Creates a new ByteArrayOutputStream , with a buffer capacity of the specified size, in bytes.

Method

voidclose()
Closing a ByteArrayOutputStream has no effect.
voidflush()
Flushes this output stream and forces any buffered output bytes to be written out.
voidnotifyAll()
Wakes up all threads that are waiting on this object's monitor.
voidreset()
Resets the count field of this ByteArrayOutputStream to zero, so that all currently accumulated output in the output stream is discarded.
intsize()
Returns the current size of the buffer.
byte[]toByteArray()
Creates a newly allocated byte array.
StringtoString()
Converts the buffer's contents into a string decoding bytes using the platform's default character set.
StringtoString(String charsetName)
Converts the buffer's contents into a string by decoding the bytes using the named java.nio.charset.Charset charset .
StringtoString(Charset charset)
Converts the buffer's contents into a string by decoding the bytes using the specified java.nio.charset.Charset charset .
StringtoString(int hibyte)
Creates a newly allocated string.
voidwait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
voidwrite(int b)
Writes the specified byte to this ByteArrayOutputStream .
voidwrite(byte b[], int off, int len)
Writes len bytes from the specified byte array starting at offset off to this ByteArrayOutputStream .
voidwriteTo(OutputStream out)
Writes the complete contents of this ByteArrayOutputStream to the specified output stream argument, as if by calling the output stream's write method using out.write(buf, 0, count) .