Package io.minio
Class ByteBuffer
java.lang.Object
java.io.OutputStream
io.minio.ByteBuffer
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
OutputStream compatible byte buffer to store bytes to maximum 5GiB in size.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this buffer and releases any system resources associated with the buffer.Returns this buffer asInputStream.longlength()Returns the current length of bytes written to this buffer.voidreset()Resets this buffer to freshen up for reuse.longsize()Returns the size of this buffer.voidwrite(byte[] b) Writes b.length bytes from the specified byte array to this buffer.voidwrite(byte[] b, int off, int len) Writes len bytes from the specified byte array starting at offset off to this buffer.voidwrite(int b) Writes the specified byte to this buffer.Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
Constructor Details
-
ByteBuffer
public ByteBuffer(long size) Creates ByteBuffer for given size.
-
-
Method Details
-
write
Writes the specified byte to this buffer.- Specified by:
writein classOutputStream- Throws:
IOException
-
write
Writes len bytes from the specified byte array starting at offset off to this buffer.- Overrides:
writein classOutputStream- Throws:
IOException
-
write
Writes b.length bytes from the specified byte array to this buffer.- Overrides:
writein classOutputStream- Throws:
IOException
-
length
public long length()Returns the current length of bytes written to this buffer. -
size
public long size()Returns the size of this buffer. -
reset
Resets this buffer to freshen up for reuse.- Throws:
MinioException
-
close
Closes this buffer and releases any system resources associated with the buffer.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
inputStream
Returns this buffer asInputStream.
-