org.apache.ignite.internal.processors.cache.persistence.wal

## Class FileInput

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.wal.FileInput

All Implemented Interfaces:
  DataInput, ByteBufferBackedDataInput

    public final class FileInput
    extends Object
    implements ByteBufferBackedDataInput

File input, backed by byte buffer file input. This class allows to read data by chunks from file and then read primitives

### Nested Class Summary

Nested Classes
`class` `FileInput.Crc32CheckingFileInput` Checking of CRC32.

### Constructor Summary

Constructors
Constructor and Description
`FileInput(FileIO io, ByteBufferExpander buf)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ByteBuffer` `buffer()`
`void` `ensure(int requested)` ensure that requested count of byte is available in data input and will try to load data if not
`FileIO` `io()` File I/O.
`long` `position()`
`boolean` `readBoolean()`
`byte` `readByte()`
`char` `readChar()`
`double` `readDouble()`
`float` `readFloat()`
`void` `readFully(byte[] b)`
`void` `readFully(byte[] b, int off, int len)`
`int` `readInt()`
`String` `readLine()`
`long` `readLong()`
`short` `readShort()`
`int` `readUnsignedByte()`
`int` `readUnsignedShort()`
`String` `readUTF()`
`void` `seek(long pos)`
`int` `skipBytes(int n)`
`FileInput.Crc32CheckingFileInput` `startRead(boolean skipCheck)`

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

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

### Constructor Detail

#### FileInput

    public FileInput(FileIO io,
                     ByteBufferExpander buf)
              throws IOException

Parameters:
  `io` - FileIO to read from.
  `buf` - Buffer for reading blocks of data into.
Throws:
  `IOException`

### Method Detail

#### io

    public FileIO io()

File I/O.

#### seek

    public void seek(long pos)
              throws IOException

Parameters:
  `pos` - Position in bytes from file begin.
Throws:
  `IOException`

#### buffer

    public ByteBuffer buffer()

Specified by:
  `buffer` in interface `ByteBufferBackedDataInput`
Returns:
  Underlying buffer.

#### ensure

    public void ensure(int requested)
                throws IOException

ensure that requested count of byte is available in data input and will try to load data if not

Specified by:
  `ensure` in interface `ByteBufferBackedDataInput`
Parameters:
  `requested` - Requested number of bytes.
Throws:
  `IOException` - If failed.

#### position

    public long position()

Returns:
  Position in the stream.

#### readFully

    public void readFully(@NotNull
                          byte[] b)
                   throws IOException

Specified by:
  `readFully` in interface `DataInput`
Throws:
  `IOException`

#### readFully

    public void readFully(@NotNull
                          byte[] b,
                          int off,
                          int len)
                   throws IOException

Specified by:
  `readFully` in interface `DataInput`
Throws:
  `IOException`

#### skipBytes

    public int skipBytes(int n)
                  throws IOException

Specified by:
  `skipBytes` in interface `DataInput`
Throws:
  `IOException`

#### readBoolean

    public boolean readBoolean()
                        throws IOException

Specified by:
  `readBoolean` in interface `DataInput`
Throws:
  `IOException`

#### readByte

    public byte readByte()
                  throws IOException

Specified by:
  `readByte` in interface `DataInput`
Throws:
  `IOException`

#### readUnsignedByte

    public int readUnsignedByte()
                         throws IOException

Specified by:
  `readUnsignedByte` in interface `DataInput`
Throws:
  `IOException`

#### readShort

    public short readShort()
                    throws IOException

Specified by:
  `readShort` in interface `DataInput`
Throws:
  `IOException`

#### readUnsignedShort

    public int readUnsignedShort()
                          throws IOException

Specified by:
  `readUnsignedShort` in interface `DataInput`
Throws:
  `IOException`

#### readChar

    public char readChar()
                  throws IOException

Specified by:
  `readChar` in interface `DataInput`
Throws:
  `IOException`

#### readInt

    public int readInt()
                throws IOException

Specified by:
  `readInt` in interface `DataInput`
Throws:
  `IOException`

#### readLong

    public long readLong()
                  throws IOException

Specified by:
  `readLong` in interface `DataInput`
Throws:
  `IOException`

#### readFloat

    public float readFloat()
                    throws IOException

Specified by:
  `readFloat` in interface `DataInput`
Throws:
  `IOException`

#### readDouble

    public double readDouble()
                      throws IOException

Specified by:
  `readDouble` in interface `DataInput`
Throws:
  `IOException`

#### readLine

    public String readLine()
                    throws IOException

Specified by:
  `readLine` in interface `DataInput`
Throws:
  `IOException`

#### readUTF

    public String readUTF()
                   throws IOException

Specified by:
  `readUTF` in interface `DataInput`
Throws:
  `IOException`

#### startRead

    public FileInput.Crc32CheckingFileInput startRead(boolean skipCheck)

Parameters:
  `skipCheck` - If CRC check should be skipped.
Returns:
  autoclosable fileInput, after its closing crc32 will be calculated and compared with saved one

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018