@Internal public abstract class AbstractMultiFSDataInputStream extends FSDataInputStream
FSDataInputStream, which gives a contiguous view on all inner
streams and makes them look like a single stream, in which we can read, seek, etc.| Modifier and Type | Field and Description |
|---|---|
protected FSDataInputStream |
delegate
Inner stream for the currently accessed segment of the virtual global stream
|
protected long |
totalAvailable
Total available bytes in the virtual global stream
|
protected long |
totalPos
Position in the virtual global stream
|
| Constructor and Description |
|---|
AbstractMultiFSDataInputStream() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getPos()
Gets the current position in the input stream.
|
protected abstract FSDataInputStream |
getSeekedStreamForOffset(long globalStreamOffset)
Delivers a the right stream for the given global stream offset.
|
int |
read() |
void |
seek(long desired)
Seek to the given offset from the start of the file.
|
long |
skip(long n) |
available, mark, markSupported, read, read, resetprotected FSDataInputStream delegate
protected long totalPos
protected long totalAvailable
public void seek(long desired)
throws IOException
FSDataInputStreamseek in class FSDataInputStreamdesired - the desired offsetIOException - Thrown if an error occurred while seeking inside the input stream.public long getPos()
throws IOException
FSDataInputStreamgetPos in class FSDataInputStreamIOException - Thrown if an I/O error occurred in the underlying stream
implementation while accessing the stream's position.public int read()
throws IOException
read in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionprotected abstract FSDataInputStream getSeekedStreamForOffset(long globalStreamOffset) throws IOException
globalStreamOffset - the global offset to which we seekIOExceptionCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.