public class ByteBuffer extends OutputStream
OutputStream compatible byte buffer to store bytes to maximum 5GiB in size.| Constructor and Description |
|---|
ByteBuffer(long size)
Creates ByteBuffer for given size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this buffer and releases any system resources associated with the buffer.
|
InputStream |
inputStream()
Returns this buffer as
InputStream. |
long |
length()
Returns the current length of bytes written to this buffer.
|
void |
reset()
Resets this buffer to freshen up for reuse.
|
long |
size()
Returns the size of this buffer.
|
void |
write(byte[] b)
Writes b.length bytes from the specified byte array to this buffer.
|
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array starting at offset off to this buffer.
|
void |
write(int b)
Writes the specified byte to this buffer.
|
flushpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic long length()
public long size()
public void reset()
throws MinioException
MinioExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic InputStream inputStream()
InputStream.