THE PACKAGE JAVA.IO
java.io.ByteArrayOutputStream
22.18
22.18 The Class
java.io.ByteArrayOutputStream
A
ByteArrayOutputStream
contains an internal buffer that accumulates all the
bytes written to the stream since its creation or the most recent call to the
reset
method. At any point, the bytes written to the stream so far may be retrieved in the
form of an array of bytes or a
String
. The bytes written so far may also be copied
to some other output stream. The
size
method returns the number of characters
written so far.
public class ByteArrayOutputStream extends OutputStream {
protected byte[] buf;
protected int count;
public ByteArrayOutputStream();
public ByteArrayOutputStream(int size);
public void write(int b);
public void write(byte[] b, int off, int len)
throws NullPointerException, IndexOutOfBoundsException;
public int size();
public void reset();
public byte[] toByteArray();
public String toString();
public String toString(int hibyte);
public void writeTo(OutputStream out) throws IOException;
}
22.18.1
protected byte[] buf;
An internal array of bytes. Elements
buf[0]
through
buf[count 1]
are the bytes
that have been written to the stream since its creation or the last
reset
( 22.18.8)
operation.
22.18.2
protected int count;
This value should always be nonnegative. It is the number of bytes that have been
written to the stream since its creation or the last
reset
( 22.18.8) operation.
22.18.3
public ByteArrayOutputStream()
This constructor initializes a newly created
ByteArrayOutputStream
so that its
internal buffer array has length 32.
727
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved