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

## Class SimpleFileInput

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

All Implemented Interfaces:
  DataInput, ByteBufferBackedDataInput, FileInput

    public class SimpleFileInput
    extends Object
    implements FileInput

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/interfaces inherited from interface org.apache.ignite.internal.processors.cache.persistence.wal.io.FileInput

`FileInput.Crc32CheckingFileInput`

### Field Summary

Fields
`protected FileIO` `io` I/O interface for read/write operations with file

### Constructor Summary

Constructors
Constructor and Description
`SimpleFileInput(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(@NotNull byte[] b)`
`void` `readFully(@NotNull 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`

### Field Detail

#### io

    protected FileIO io

I/O interface for read/write operations with file

### Constructor Detail

#### SimpleFileInput

    public SimpleFileInput(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.

Specified by:
  `io` in interface `FileInput`

#### seek

    public void seek(long pos)
              throws IOException

Specified by:
  `seek` in interface `FileInput`
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()

Specified by:
  `position` in interface `FileInput`
Returns:
  Position in the stream.

#### readFully

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

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

#### readFully

    public void readFully(@NotNull
                          @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)

Specified by:
  `startRead` in interface `FileInput`
Parameters:
  `skipCheck` - If CRC check should be skipped.
Returns:
  autoclosable fileInput, after its closing crc will be calculated and compared with saved one

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021