org.apache.ignite.igfs

## Class IgfsInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.apache.ignite.igfs.IgfsInputStream

All Implemented Interfaces:
  Closeable, AutoCloseable

Direct Known Subclasses:
  IgfsInputStreamImpl, IgfsRangeInputStream

    public abstract class IgfsInputStream
    extends InputStream

`IGFS` input stream to read data from the file system. It provides several additional methods for asynchronous access.

### Constructor Summary

Constructors
Constructor and Description
`IgfsInputStream()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract long` `length()` Gets file length during file open.
`abstract long` `position()` Get the current position in the input stream.
`abstract int` `read(long pos, byte[] buf, int off, int len)`
`abstract void` `readFully(long pos, byte[] buf)` Read bytes from the given position in the stream to the given buffer.
`abstract void` `readFully(long pos, byte[] buf, int off, int len)`
`abstract void` `seek(long pos)` Seek to the specified position.

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

`available, close, mark, markSupported, read, read, read, reset, skip`

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

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

### Constructor Detail

#### IgfsInputStream

    public IgfsInputStream()

### Method Detail

#### length

    public abstract long length()

Gets file length during file open.

Returns:
  File length.

#### seek

    public abstract void seek(long pos)
                       throws IOException

Seek to the specified position.

Parameters:
  `pos` - Position to seek to.
Throws:
  `IOException` - In case of IO exception.

#### position

    public abstract long position()
                           throws IOException

Get the current position in the input stream.

Returns:
  The current position in the input stream.
Throws:
  `IOException` - In case of IO exception.

#### readFully

    public abstract void readFully(long pos,
                                   byte[] buf)
                            throws IOException

Read bytes from the given position in the stream to the given buffer. Continues to read until passed buffer becomes filled.

Parameters:
  `pos` - Position in the input stream to seek.
  `buf` - Buffer into which data is read.
Throws:
  `IOException` - In case of IO exception.

#### readFully

    public abstract void readFully(long pos,
                                   byte[] buf,
                                   int off,
                                   int len)
                            throws IOException

Parameters:
  `pos` - Position in the input stream to seek.
  `buf` - Buffer into which data is read.
  `off` - Offset in the buffer from which stream data should be written.
  `len` - The number of bytes to read.
Throws:
  `IOException` - In case of IO exception.

#### read

    public abstract int read(long pos,
                             byte[] buf,
                             int off,
                             int len)
                      throws IOException

Parameters:
  `pos` - Position in the input stream to seek.
  `buf` - Buffer into which data is read.
  `off` - Offset in the buffer from which stream data should be written.
  `len` - The number of bytes to read.
Returns:
  Total number of bytes read into the buffer, or -1 if there is no more data (EOF).
Throws:
  `IOException` - In case of IO exception.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.8.0
Release Date | : February 27 2020