Package org.apache.cassandra.io.util
Interface DataInputPlus
-
- All Superinterfaces:
java.io.DataInput
- All Known Subinterfaces:
FileDataInput,RewindableDataInput,StreamingDataInputPlus
- All Known Implementing Classes:
AsyncStreamingInputPlus,ChecksummedDataInput,CompressedChecksummedDataInput,CompressedInputStream,DataInputBuffer,DataInputPlus.DataInputStreamPlus,EncryptedChecksummedDataInput,EncryptedFileSegmentInputStream,FileInputStreamPlus,FileSegmentInputStream,MemoryInputStream,NIODataInputStream,RandomAccessReader,RebufferingInputStream,StreamCompressionInputStream,TrackedDataInputPlus
public interface DataInputPlus extends java.io.DataInputExtension to DataInput that provides support for reading varints
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDataInputPlus.DataInputStreamPlusWrapper around an InputStream that provides no buffering but can decode varints TODO: probably shouldn't use DataInputStream as a parent
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default longreadUnsignedVInt()Think hard before opting for an unsigned encoding.default longreadVInt()intskipBytes(int n)Always skips the requested number of bytes, unless EOF is reacheddefault voidskipBytesFully(int n)
-
-
-
Method Detail
-
readVInt
default long readVInt() throws java.io.IOException- Throws:
java.io.IOException
-
readUnsignedVInt
default long readUnsignedVInt() throws java.io.IOExceptionThink hard before opting for an unsigned encoding. Is this going to bite someone because some day they might need to pass in a sentinel value using negative numbers? Is the risk worth it to save a few bytes? Signed, not a fan of unsigned values in protocols and formats- Throws:
java.io.IOException
-
skipBytes
int skipBytes(int n) throws java.io.IOExceptionAlways skips the requested number of bytes, unless EOF is reached- Specified by:
skipBytesin interfacejava.io.DataInput- Parameters:
n- number of bytes to skip- Returns:
- number of bytes skipped
- Throws:
java.io.IOException
-
skipBytesFully
default void skipBytesFully(int n) throws java.io.IOException- Throws:
java.io.IOException
-
-