public class FastByteArrayOutputStream extends OutputStream
Caution: This class is not thread safe.
Constructor and Description |
---|
FastByteArrayOutputStream()
Standard constructor.
|
FastByteArrayOutputStream(int initialAllocation)
Constructs an instance of this class with the specified initial buffer
size.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
getSize()
Gets the size of the data collection, in bytes.
|
byte[] |
toByteArray()
Gets the content of the buffer in the form of a byte array.
|
String |
toString() |
void |
write(byte[] data,
int poffset,
int plength) |
void |
write(int datum) |
flush, write
public FastByteArrayOutputStream()
public FastByteArrayOutputStream(int initialAllocation)
initialAllocation
- the initial buffer size, in bytes.public int getSize()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
public byte[] toByteArray()
public void write(int datum) throws IOException
write
in class OutputStream
IOException
public void write(byte[] data, int poffset, int plength) throws IOException
write
in class OutputStream
IOException
Copyright © 2022. All rights reserved.