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

## Interface RecordIO

    public interface RecordIO

Internal interface to provide size, read and write operations of WAL records including record header and data.

### Method Summary

All Methods Instance Methods Abstract Methods
`WALRecord` `readWithHeaders(ByteBufferBackedDataInput in, WALPointer expPtr)` Reads record data with headers from `in`.
`int` `sizeWithHeaders(WALRecord record)` Calculates and returns size of record data and headers.
`void` `writeWithHeaders(WALRecord record, ByteBuffer buf)` Writes record data with headers to `buf`.

### Method Detail

#### sizeWithHeaders

    int sizeWithHeaders(WALRecord record)
                 throws IgniteCheckedException

Calculates and returns size of record data and headers.

Parameters:
  `record` - WAL record.
Returns:
  Size in bytes.
Throws:
  `IgniteCheckedException` - If it's unable to calculate size of record.

#### readWithHeaders

    WALRecord readWithHeaders(ByteBufferBackedDataInput in,
                              WALPointer expPtr)
                       throws IOException,
                              IgniteCheckedException

Reads record data with headers from `in`.

Parameters:
  `in` - Buffer to read.
  `expPtr` - Expected WAL pointer for record. Used to validate actual position against expected from the file.
Returns:
  WAL record.
Throws:
  `IOException` - In case of I/O problems.
  `IgniteCheckedException` - If it's unable to read record.

#### writeWithHeaders

    void writeWithHeaders(WALRecord record,
                          ByteBuffer buf)
                   throws IgniteCheckedException

Writes record data with headers to `buf`.

Parameters:
  `record` - WAL record.
  `buf` - Buffer to write.
Throws:
  `IgniteCheckedException` - If it's unable to write record.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022