java.io
Class ByteArrayOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
public class ByteArrayOutputStream
- extends OutputStream
Output stream that writes to a byte[].
Compliance: CLDC: 1.0 complete
Compliance: J2SE: 1.4 complete
|
Field Summary |
protected byte[] |
buf
|
protected int |
count
|
buf
protected byte[] buf
count
protected int count
ByteArrayOutputStream
public ByteArrayOutputStream()
ByteArrayOutputStream
public ByteArrayOutputStream(int size)
close
public void close()
throws IOException
- Overrides:
close in class OutputStream
- Throws:
IOException
flush
public void flush()
throws IOException
- Overrides:
flush in class OutputStream
- Throws:
IOException
reset
public void reset()
size
public int size()
toByteArray
public byte[] toByteArray()
toString
public String toString()
- Overrides:
toString in class Object
toString
public String toString(int hibyte)
toString
public String toString(String enc)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
write
public void write(int b)
- Specified by:
write in class OutputStream
write
public void write(byte[] b,
int off,
int len)
- Overrides:
write in class OutputStream
writeTo
public void writeTo(OutputStream out)
throws IOException
- Throws:
IOException