java.io.Closeable, java.lang.AutoCloseable, PositionedReadable, SeekableFSInputChecker, FTPInputStream@Public @Evolving public abstract class FSInputStream extends java.io.InputStream implements Seekable, PositionedReadable
| Constructor | Description |
|---|---|
FSInputStream() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract long |
getPos() |
Return the current offset from the start of the file
|
int |
read(long position,
byte[] buffer,
int offset,
int length) |
Read up to the specified number of bytes, from a given
position within a file, and return the number of bytes read.
|
void |
readFully(long position,
byte[] buffer) |
Read number of bytes equal to the length of the buffer, from a given
position within a file.
|
void |
readFully(long position,
byte[] buffer,
int offset,
int length) |
Read the specified number of bytes, from a given
position within a file.
|
abstract void |
seek(long pos) |
Seek to the given offset from the start of the file.
|
abstract boolean |
seekToNewSource(long targetPos) |
Seeks a different copy of the data.
|
java.lang.String |
toString() |
toString method returns the superclass toString, but if the subclass
implements
IOStatisticsSource then those statistics are
extracted and included in the output. |
protected void |
validatePositionedReadArgs(long position,
byte[] buffer,
int offset,
int length) |
Validation code, available for use in subclasses.
|
available, close, mark, markSupported, nullInputStream, read, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferToclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmaxReadSizeForVectorReads, minSeekForVectorReads, readVectoredpublic abstract void seek(long pos)
throws java.io.IOException
public abstract long getPos()
throws java.io.IOException
public abstract boolean seekToNewSource(long targetPos)
throws java.io.IOException
seekToNewSource in interface SeekabletargetPos - target position.java.io.IOException - raised on errors performing I/O.public int read(long position,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
PositionedReadableread in interface PositionedReadableposition - position within filebuffer - destination bufferoffset - offset in the bufferlength - number of bytes to readjava.io.IOException - IO problems.protected void validatePositionedReadArgs(long position,
byte[] buffer,
int offset,
int length)
throws java.io.EOFException
position - position: if negative an EOF exception is raisedbuffer - destination bufferoffset - offset within the bufferlength - length of bytes to readjava.io.EOFException - if the position is negativejava.lang.IndexOutOfBoundsException - if there isn't space for the amount of
data requested.java.lang.IllegalArgumentException - other arguments are invalid.public void readFully(long position,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
PositionedReadablereadFully in interface PositionedReadableposition - position within filebuffer - destination bufferoffset - offset in the bufferlength - number of bytes to readjava.io.IOException - IO problems.java.io.EOFException - the end of the data was reached before
the read operation completedpublic void readFully(long position,
byte[] buffer)
throws java.io.IOException
PositionedReadablereadFully in interface PositionedReadableposition - position within filebuffer - destination bufferjava.io.IOException - IO problems.java.io.EOFException - the end of the data was reached before
the read operation completedpublic java.lang.String toString()
IOStatisticsSource then those statistics are
extracted and included in the output.
That is: statistics of subclasses are automatically reported.toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.