@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, reset
protected FSDataInputStream delegate
protected long totalPos
protected long totalAvailable
public void seek(long desired) throws IOException
FSDataInputStream
seek
in class FSDataInputStream
desired
- the desired offsetIOException
- Thrown if an error occurred while seeking inside the input stream.public long getPos() throws IOException
FSDataInputStream
getPos
in class FSDataInputStream
IOException
- 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 InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
protected abstract FSDataInputStream getSeekedStreamForOffset(long globalStreamOffset) throws IOException
globalStreamOffset
- the global offset to which we seekIOException
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.