public class ByteArrayOutputStream
extends java.io.OutputStream
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buf
The buffer where data is stored.
|
protected int |
count
The number of valid bytes in the buffer.
|
| Constructor and Description |
|---|
ByteArrayOutputStream() |
ByteArrayOutputStream(int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
reset() |
int |
size() |
byte[] |
toByteArray() |
java.lang.String |
toString() |
java.lang.String |
toString(int hibyte)
Deprecated.
deprecated use
|
java.lang.String |
toString(java.lang.String charsetName) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeTo(java.io.OutputStream out) |
protected byte[] buf
protected int count
public ByteArrayOutputStream()
public ByteArrayOutputStream(int size)
public void write(int b)
write in class java.io.OutputStreampublic void write(byte[] b,
int off,
int len)
write in class java.io.OutputStreampublic void writeTo(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic void reset()
public byte[] toByteArray()
public int size()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String charsetName)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException@Deprecated public java.lang.String toString(int hibyte)
hibyte - public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOException