Class SeekableInputStream
Object
java.io.InputStream
io.delta.kernel.defaults.engine.fileio.SeekableInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
HadoopSeekableInputStream
Extends
InputStream
to provide the current position in the stream and seek to a new
position. Also provides additional utility methods such as readFully(byte[], int, int)
.-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
SeekableInputStream
public SeekableInputStream()
-
-
Method Details
-
getPos
Get the current position in the stream.- Returns:
- the current position in bytes from the start of the stream
- Throws:
IOException
- if the underlying stream throws an IOException
-
seek
Seek to a new position in the stream.- Parameters:
newPos
- the new position to seek to- Throws:
IOException
- if the underlying stream throws an IOException
-
readFully
Read fully len bytes into the buffer b.- Parameters:
b
- byte arrayoff
- offset in the byte arraylen
- number of bytes to read- Throws:
EOFException
- – if this input stream reaches the end before reading all the bytes.IOException
- – the stream has been closed and the contained input stream does not support reading after close, or another I/ O error occurs.
-