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 voidclose()Closes a read-stream.longgetLength()Returns the exact length in bytes of the stream.intread(byte[] b, int offset, long maxBytesToRead)byte[]read(long maxBytesToRead)Reads from an open stream.voidseek(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 LiteCoreExceptionReads 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 LiteCoreExceptionReturns the exact length in bytes of the stream.- Throws:
LiteCoreException
-
seek
public void seek(long position) throws LiteCoreExceptionMoves 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.
-
-