Package org.apache.cassandra.io.util
Class DataInputBuffer
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.cassandra.io.util.RebufferingInputStream
-
- org.apache.cassandra.io.util.DataInputBuffer
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataInput,java.lang.AutoCloseable,DataInputPlus
- Direct Known Subclasses:
FileSegmentInputStream
public class DataInputBuffer extends RebufferingInputStream
Input stream around a single ByteBuffer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.io.util.DataInputPlus
DataInputPlus.DataInputStreamPlus
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.io.util.RebufferingInputStream
buffer
-
-
Constructor Summary
Constructors Constructor Description DataInputBuffer(byte[] buffer)DataInputBuffer(byte[] buffer, int offset, int length)DataInputBuffer(java.nio.ByteBuffer buffer, boolean duplicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()protected voidreBuffer()Implementations must implement this method to refill the buffer.-
Methods inherited from class org.apache.cassandra.io.util.RebufferingInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readFully, readInt, readLine, readLong, readPrimitiveSlowly, readShort, readUnsignedByte, readUnsignedShort, readUnsignedVInt, readUTF, readVInt, skipBytes
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.io.util.DataInputPlus
skipBytesFully
-
-
-
-
Constructor Detail
-
DataInputBuffer
public DataInputBuffer(java.nio.ByteBuffer buffer, boolean duplicate)- Parameters:
buffer-duplicate- Whether or not to duplicate the buffer to ensure thread safety
-
DataInputBuffer
public DataInputBuffer(byte[] buffer, int offset, int length)
-
DataInputBuffer
public DataInputBuffer(byte[] buffer)
-
-
Method Detail
-
reBuffer
protected void reBuffer()
Description copied from class:RebufferingInputStreamImplementations must implement this method to refill the buffer. They can expect the buffer to be empty when this method is invoked.- Specified by:
reBufferin classRebufferingInputStream
-
available
public int available()
- Overrides:
availablein classjava.io.InputStream
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream
-
-