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 intavailable()voidmark(int readlimit)booleanmarkSupported()longposition()intread()intread(byte[] b, int off, int len)intread(ByteBuffer out)List<ByteBuffer>remainingBuffers()ByteBufferInputStreamremainingStream()voidreset()longskip(long n)voidskipFully(long n)ByteBufferslice(int length)List<ByteBuffer>sliceBuffers(long length)ByteBufferInputStreamsliceStream(long length)ByteBuffertoByteBuffer()Deprecated.Will be removed in 2.0.0; Useslice(int)insteadstatic ByteBufferInputStreamwrap(ByteBuffer... buffers)static ByteBufferInputStreamwrap(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:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
skip
public long skip(long n)
- Overrides:
skipin classInputStream
-
available
public int available()
- Overrides:
availablein classInputStream
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
-