public class SnapshotReader extends Object implements BufferInput<SnapshotReader>
Snapshot.
This class provides the primary interface for reading snapshot buffers from disk or memory.
Snapshot bytes are read from an underlying Buffer which is backed by either memory
or disk based on the configured StorageLevel.
In addition to standard BufferInput methods, snapshot readers support reading serializable objects
from the snapshot via the readObject() method. Serializable types must be registered on the
CopycatServer serializer to be supported in snapshots.
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasRemaining() |
SnapshotReader |
read(Buffer buffer) |
SnapshotReader |
read(byte[] bytes) |
SnapshotReader |
read(byte[] bytes,
long offset,
long length) |
SnapshotReader |
read(Bytes bytes) |
SnapshotReader |
read(Bytes bytes,
long offset,
long length) |
boolean |
readBoolean() |
int |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
int |
readInt() |
long |
readLong() |
int |
readMedium() |
<T> T |
readObject()
Reads an object from the buffer.
|
short |
readShort() |
String |
readString() |
int |
readUnsignedByte() |
long |
readUnsignedInt() |
int |
readUnsignedMedium() |
int |
readUnsignedShort() |
String |
readUTF8() |
long |
remaining() |
SnapshotReader |
skip(long bytes) |
public long remaining()
remaining in interface BufferInput<SnapshotReader>public boolean hasRemaining()
hasRemaining in interface BufferInput<SnapshotReader>public SnapshotReader skip(long bytes)
skip in interface BufferInput<SnapshotReader>public <T> T readObject()
T - The type of the object to read.public SnapshotReader read(Bytes bytes)
read in interface BufferInput<SnapshotReader>public SnapshotReader read(byte[] bytes)
read in interface BufferInput<SnapshotReader>public SnapshotReader read(Bytes bytes, long offset, long length)
read in interface BufferInput<SnapshotReader>public SnapshotReader read(byte[] bytes, long offset, long length)
read in interface BufferInput<SnapshotReader>public SnapshotReader read(Buffer buffer)
read in interface BufferInput<SnapshotReader>public int readByte()
readByte in interface BufferInput<SnapshotReader>public int readUnsignedByte()
readUnsignedByte in interface BufferInput<SnapshotReader>public char readChar()
readChar in interface BufferInput<SnapshotReader>public short readShort()
readShort in interface BufferInput<SnapshotReader>public int readUnsignedShort()
readUnsignedShort in interface BufferInput<SnapshotReader>public int readMedium()
readMedium in interface BufferInput<SnapshotReader>public int readUnsignedMedium()
readUnsignedMedium in interface BufferInput<SnapshotReader>public int readInt()
readInt in interface BufferInput<SnapshotReader>public long readUnsignedInt()
readUnsignedInt in interface BufferInput<SnapshotReader>public long readLong()
readLong in interface BufferInput<SnapshotReader>public float readFloat()
readFloat in interface BufferInput<SnapshotReader>public double readDouble()
readDouble in interface BufferInput<SnapshotReader>public boolean readBoolean()
readBoolean in interface BufferInput<SnapshotReader>public String readString()
readString in interface BufferInput<SnapshotReader>public String readUTF8()
readUTF8 in interface BufferInput<SnapshotReader>public void close()
close in interface BufferInput<SnapshotReader>close in interface AutoCloseableCopyright © 2013–2016. All rights reserved.