Package org.apache.hadoop.fs.ftp
Class FTPInputStream
java.lang.Object
java.io.InputStream
org.apache.hadoop.fs.FSInputStream
org.apache.hadoop.fs.ftp.FTPInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable,PositionedReadable,Seekable
-
Constructor Summary
ConstructorsConstructorDescriptionFTPInputStream(InputStream stream, org.apache.commons.net.ftp.FTPClient client, FileSystem.Statistics stats) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longgetPos()Return the current offset from the start of the filevoidmark(int readLimit) booleanintread()intread(byte[] buf, int off, int len) voidreset()voidseek(long pos) Seek to the given offset from the start of the file.booleanseekToNewSource(long targetPos) Seeks a different copy of the data.Methods inherited from class org.apache.hadoop.fs.FSInputStream
read, readFully, readFully, toString, validatePositionedReadArgsMethods inherited from class java.io.InputStream
available, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.fs.PositionedReadable
maxReadSizeForVectorReads, minSeekForVectorReads, readVectored, readVectored
-
Constructor Details
-
FTPInputStream
public FTPInputStream(InputStream stream, org.apache.commons.net.ftp.FTPClient client, FileSystem.Statistics stats)
-
-
Method Details
-
getPos
Description copied from class:FSInputStreamReturn the current offset from the start of the file- Specified by:
getPosin interfaceSeekable- Specified by:
getPosin classFSInputStream- Returns:
- offset from the start of the file.
- Throws:
IOException- raised on errors performing I/O.
-
seek
Description copied from class:FSInputStreamSeek to the given offset from the start of the file. The next read() will be from that location. Can't seek past the end of the file.- Specified by:
seekin interfaceSeekable- Specified by:
seekin classFSInputStream- Parameters:
pos- offset from the start of the file.- Throws:
IOException- raised on errors performing I/O.
-
seekToNewSource
Description copied from class:FSInputStreamSeeks a different copy of the data. Returns true if found a new source, false otherwise.- Specified by:
seekToNewSourcein interfaceSeekable- Specified by:
seekToNewSourcein classFSInputStream- Parameters:
targetPos- target position.- Returns:
- true if found a new source, false otherwise.
- Throws:
IOException- raised on errors performing I/O.
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
mark
public void mark(int readLimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-