public class ByteArrayOutputStream extends OutputStream
| Constructor and Description |
|---|
ByteArrayOutputStream() |
ByteArrayOutputStream(OutputStream outputStream) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
byte[] |
toByteArray() |
void |
write(int b) |
void |
writeInteger(int value,
int length)
Write int in little-endian format.
|
void |
writeLong(long value,
int length)
Write long in little-endian format.
|
void |
writeString(String value) |
void |
writeZeroTerminatedString(String value) |
write, writepublic ByteArrayOutputStream()
public ByteArrayOutputStream(OutputStream outputStream)
public void writeInteger(int value,
int length)
throws IOException
IOExceptionpublic void writeLong(long value,
int length)
throws IOException
IOExceptionpublic void writeString(String value) throws IOException
IOExceptionpublic void writeZeroTerminatedString(String value) throws IOException
IOExceptionByteArrayInputStream.readZeroTerminatedString()public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic byte[] toByteArray()
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2017. All rights reserved.