Package com.couchbase.lite.internal.core
Class C4BlobReadStream
- java.lang.Object
-
- com.couchbase.lite.internal.core.C4NativePeer
-
- com.couchbase.lite.internal.core.C4BlobReadStream
-
- All Implemented Interfaces:
AutoCloseable
public class C4BlobReadStream extends C4NativePeer
An open stream for reading data from a blob.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes a read-stream.long
getLength()
Returns the exact length in bytes of the stream.int
read(byte[] b, int offset, long maxBytesToRead)
byte[]
read(long maxBytesToRead)
Reads from an open stream.void
seek(long position)
Moves to a random location in the stream; the next c4stream_read call will read from that location.-
Methods inherited from class com.couchbase.lite.internal.core.C4NativePeer
toString
-
-
-
-
Method Detail
-
read
@NonNull public byte[] read(long maxBytesToRead) throws LiteCoreException
Reads from an open stream.- Parameters:
maxBytesToRead
- The maximum number of bytes to read to the buffer- Throws:
LiteCoreException
-
read
public int read(byte[] b, int offset, long maxBytesToRead) throws LiteCoreException
- Throws:
LiteCoreException
-
getLength
public long getLength() throws LiteCoreException
Returns the exact length in bytes of the stream.- Throws:
LiteCoreException
-
seek
public void seek(long position) throws LiteCoreException
Moves to a random location in the stream; the next c4stream_read call will read from that location.- Throws:
LiteCoreException
-
close
@CallSuper public void close()
Closes a read-stream.
-
-