FTPInputStream (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs.ftp, class: FTPInputStream

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`

@Private @Unstable public class FTPInputStream extends FSInputStream

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FTPInputStream(InputStream stream, org.apache.commons.net.ftp.FTPClient client, FileSystem.Statistics stats)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `long`
  `getPos()`
  Return the current offset from the start of the file
  `void`
  `mark(int readLimit)`
  `boolean`
  `markSupported()`
  `int`
  `read()`
  `int`
  `read(byte[] buf, int off, int len)`
  `void`
  `reset()`
  `void`
  `seek(long pos)`
  Seek to the given offset from the start of the file.
  `boolean`
  `seekToNewSource(long targetPos)`
  Seeks a different copy of the data.

  ### Methods inherited from class org.apache.hadoop.fs.FSInputStream

  `read, readFully, readFully, toString, validatePositionedReadArgs`

  ### Methods inherited from class java.io.InputStream

  `available, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods 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

    public long getPos() throws IOException
    Description copied from class: `FSInputStream`
    Return the current offset from the start of the file
    Specified by:
      `getPos` in interface `Seekable`
    Specified by:
      `getPos` in class `FSInputStream`
    Returns:
      offset from the start of the file.
    Throws:
      `IOException` - raised on errors performing I/O.

  - ### seek

    public void seek(long pos) throws IOException
    Description copied from class: `FSInputStream`
    Seek 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:
      `seek` in interface `Seekable`
    Specified by:
      `seek` in class `FSInputStream`
    Parameters:
      `pos` - offset from the start of the file.
    Throws:
      `IOException` - raised on errors performing I/O.

  - ### seekToNewSource

    public boolean seekToNewSource(long targetPos) throws IOException
    Description copied from class: `FSInputStream`
    Seeks a different copy of the data. Returns true if found a new source, false otherwise.
    Specified by:
      `seekToNewSource` in interface `Seekable`
    Specified by:
      `seekToNewSource` in class `FSInputStream`
    Parameters:
      `targetPos` - target position.
    Returns:
      true if found a new source, false otherwise.
    Throws:
      `IOException` - raised on errors performing I/O.

  - ### read

    public int read() throws IOException
    Specified by:
      `read` in class `InputStream`
    Throws:
      `IOException`

  - ### read

    public int read(byte[] buf, int off, int len) throws IOException
    Overrides:
      `read` in class `InputStream`
    Throws:
      `IOException`

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `InputStream`
    Throws:
      `IOException`

  - ### markSupported

    public boolean markSupported()
    Overrides:
      `markSupported` in class `InputStream`

  - ### mark

    public void mark(int readLimit)
    Overrides:
      `mark` in class `InputStream`

  - ### reset

    public void reset() throws IOException
    Overrides:
      `reset` in class `InputStream`
    Throws:
      `IOException`