Package org.apache.parquet.bytes
Class ByteBufferInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.parquet.bytes.ByteBufferInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ByteBufferInputStream extends InputStream
-
-
Constructor Summary
Constructors Constructor Description ByteBufferInputStream(ByteBuffer buffer)
Deprecated.Will be removed in 2.0.0; Usewrap(ByteBuffer...)
insteadByteBufferInputStream(ByteBuffer buffer, int offset, int count)
Deprecated.Will be removed in 2.0.0; Usewrap(ByteBuffer...)
instead
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
available()
void
mark(int readlimit)
boolean
markSupported()
long
position()
int
read()
int
read(byte[] b, int off, int len)
int
read(ByteBuffer out)
List<ByteBuffer>
remainingBuffers()
ByteBufferInputStream
remainingStream()
void
reset()
long
skip(long n)
void
skipFully(long n)
ByteBuffer
slice(int length)
List<ByteBuffer>
sliceBuffers(long length)
ByteBufferInputStream
sliceStream(long length)
ByteBuffer
toByteBuffer()
Deprecated.Will be removed in 2.0.0; Useslice(int)
insteadstatic ByteBufferInputStream
wrap(ByteBuffer... buffers)
static ByteBufferInputStream
wrap(List<ByteBuffer> buffers)
-
Methods inherited from class java.io.InputStream
close, nullInputStream, read, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
ByteBufferInputStream
@Deprecated public ByteBufferInputStream(ByteBuffer buffer)
Deprecated.Will be removed in 2.0.0; Usewrap(ByteBuffer...)
instead- Parameters:
buffer
- the buffer to be wrapped in this input stream
-
ByteBufferInputStream
@Deprecated public ByteBufferInputStream(ByteBuffer buffer, int offset, int count)
Deprecated.Will be removed in 2.0.0; Usewrap(ByteBuffer...)
instead- Parameters:
buffer
- the buffer to be wrapped in this input streamoffset
- the offset of the data in the buffercount
- the number of bytes to be read from the buffer
-
-
Method Detail
-
wrap
public static ByteBufferInputStream wrap(ByteBuffer... buffers)
-
wrap
public static ByteBufferInputStream wrap(List<ByteBuffer> buffers)
-
toByteBuffer
@Deprecated public ByteBuffer toByteBuffer()
Deprecated.Will be removed in 2.0.0; Useslice(int)
instead- Returns:
- the slice of the byte buffer inside this stream
-
position
public long position()
-
skipFully
public void skipFully(long n) throws IOException
- Throws:
IOException
-
read
public int read(ByteBuffer out)
-
slice
public ByteBuffer slice(int length) throws EOFException
- Throws:
EOFException
-
sliceBuffers
public List<ByteBuffer> sliceBuffers(long length) throws EOFException
- Throws:
EOFException
-
sliceStream
public ByteBufferInputStream sliceStream(long length) throws EOFException
- Throws:
EOFException
-
remainingBuffers
public List<ByteBuffer> remainingBuffers()
-
remainingStream
public ByteBufferInputStream remainingStream()
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
public long skip(long n)
- Overrides:
skip
in classInputStream
-
available
public int available()
- Overrides:
available
in classInputStream
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
-