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

## Class AbstractFileIO

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.file.AbstractFileIO

All Implemented Interfaces:
  AutoCloseable, FileIO

Direct Known Subclasses:
  AsyncFileIO, FileIODecorator, RandomAccessFileIO, UnzipFileIO

    public abstract class AbstractFileIO
    extends Object
    implements FileIO

### Constructor Summary

Constructors
Constructor and Description
`AbstractFileIO()`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `readFully(byte[] buf, int off, int len)` Reads a up to `length` bytes from this file into the `buffer`.
`int` `readFully(ByteBuffer destBuf)` Reads a sequence of bytes from this file into the `destinationBuffer`.
`int` `readFully(ByteBuffer destBuf, long position)` Reads a sequence of bytes from this file into the `destinationBuffer` starting from specified file `position`.
`int` `writeFully(byte[] buf, int off, int len)` Writes `length` bytes from the `buffer` starting at offset `off` to this file.
`int` `writeFully(ByteBuffer srcBuf)` Writes a sequence of bytes to this file from the `sourceBuffer`.
`int` `writeFully(ByteBuffer srcBuf, long position)` Writes a sequence of bytes to this file from the `sourceBuffer` starting from specified file `position`

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

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

### Methods inherited from interface org.apache.ignite.internal.processors.cache.persistence.file.FileIO

`clear, close, force, force, getFileSystemBlockSize, getSparseSize, map, position, position, punchHole, read, read, read, size, transferFrom, transferTo, write, write, write`

### Constructor Detail

#### AbstractFileIO

    public AbstractFileIO()

### Method Detail

#### readFully

    public int readFully(ByteBuffer destBuf)
                  throws IOException

Reads a sequence of bytes from this file into the `destinationBuffer`.

Specified by:
  `readFully` in interface `FileIO`
Parameters:
  `destBuf` - Destination byte buffer.
Returns:
  Number of written bytes.
Throws:
  `IOException` - If some I/O error occurs.

#### readFully

    public int readFully(ByteBuffer destBuf,
                         long position)
                  throws IOException

Reads a sequence of bytes from this file into the `destinationBuffer` starting from specified file `position`.

Specified by:
  `readFully` in interface `FileIO`
Parameters:
  `destBuf` - Destination byte buffer.
  `position` - Starting position of file.
Returns:
  Number of written bytes.
Throws:
  `IOException` - If some I/O error occurs.

#### readFully

    public int readFully(byte[] buf,
                         int off,
                         int len)
                  throws IOException

Reads a up to `length` bytes from this file into the `buffer`.

Specified by:
  `readFully` in interface `FileIO`
Parameters:
  `buf` - Destination byte array.
  `off` - The start offset in array `b` at which the data is written.
  `len` - Number of bytes read.
Returns:
  Number of written bytes.
Throws:
  `IOException` - If some I/O error occurs.

#### writeFully

    public int writeFully(ByteBuffer srcBuf)
                   throws IOException

Writes a sequence of bytes to this file from the `sourceBuffer`.

Specified by:
  `writeFully` in interface `FileIO`
Parameters:
  `srcBuf` - Source buffer.
Returns:
  Number of written bytes.
Throws:
  `IOException` - If some I/O error occurs.

#### writeFully

    public int writeFully(ByteBuffer srcBuf,
                          long position)
                   throws IOException

Writes a sequence of bytes to this file from the `sourceBuffer` starting from specified file `position`

Specified by:
  `writeFully` in interface `FileIO`
Parameters:
  `srcBuf` - Source buffer.
  `position` - Starting file position.
Returns:
  Number of written bytes.
Throws:
  `IOException` - If some I/O error occurs.

#### writeFully

    public int writeFully(byte[] buf,
                          int off,
                          int len)
                   throws IOException

Writes `length` bytes from the `buffer` starting at offset `off` to this file.

Specified by:
  `writeFully` in interface `FileIO`
Parameters:
  `buf` - Source byte array.
  `off` - Start offset in the `buffer`.
  `len` - Number of bytes to write.
Returns:
  Number of written bytes.
Throws:
  `IOException` - If some I/O error occurs.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.1
Release Date | : December 20 2021