public final class ByteArrayOutputStream extends OutputStream
| Constructor and Description |
|---|
ByteArrayOutputStream() |
ByteArrayOutputStream(int size) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array() |
int |
capacity() |
void |
close() |
void |
reset()
Reset.
|
int |
size() |
byte[] |
toByteArray()
To byte array.
|
String |
toString() |
String |
toString(Charset charset) |
void |
write(byte b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeTo(OutputStream out) |
flush, writepublic ByteArrayOutputStream()
public ByteArrayOutputStream(int size)
public void write(int b)
write in class OutputStreamb - public void write(byte[] b,
int off,
int len)
write in class OutputStreamb - off - len - public void write(byte b)
b - public void writeTo(OutputStream out) throws IOException
out - IOException - Signals that an I/O exception has occurred.public int capacity()
public byte[] array()
public int size()
public void reset()
public byte[] toByteArray()
public String toString(Charset charset) throws UnsupportedEncodingException
charset - UnsupportedEncodingException - the unsupported encoding exceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOException - Signals that an I/O exception has occurred.Copyright © 2021. All rights reserved.