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

## Class CacheVersionIO

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.tree.io.CacheVersionIO

    public class CacheVersionIO
    extends Object

Utility to read and write `GridCacheVersion` instances.

### Constructor Summary

Constructors
Constructor and Description
`CacheVersionIO()`

### Method Summary

All Methods Static Methods Concrete Methods
`static GridCacheVersion` `read(ByteBuffer buf, boolean allowNull)` Reads GridCacheVersion instance from the given buffer.
`static GridCacheVersion` `read(long pageAddr, boolean allowNull)` Reads GridCacheVersion instance from the given address.
`static int` `readSize(ByteBuffer buf, boolean allowNull)` Gets needed buffer size to read the whole version instance.
`static int` `size(GridCacheVersion ver, boolean allowNull)`
`static void` `write(ByteBuffer buf, GridCacheVersion ver, boolean allowNull)`
`static void` `write(long addr, GridCacheVersion ver, boolean allowNull)`

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

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

### Constructor Detail

#### CacheVersionIO

    public CacheVersionIO()

### Method Detail

#### size

    public static int size(GridCacheVersion ver,
                           boolean allowNull)

Parameters:
  `ver` - Version.
  `allowNull` - Is `null` version allowed.
Returns:
  Serialized size in bytes.

#### write

    public static void write(ByteBuffer buf,
                             GridCacheVersion ver,
                             boolean allowNull)

Parameters:
  `buf` - Byte buffer.
  `ver` - Version to write.
  `allowNull` - Is `null` version allowed.

#### write

    public static void write(long addr,
                             GridCacheVersion ver,
                             boolean allowNull)

Parameters:
  `addr` - Write address.
  `ver` - Version to write.
  `allowNull` - Is `null` version allowed.

#### readSize

    public static int readSize(ByteBuffer buf,
                               boolean allowNull)
                        throws IgniteCheckedException

Gets needed buffer size to read the whole version instance. Does not change buffer position.

Parameters:
  `buf` - Buffer.
  `allowNull` - Is `null` version allowed.
Returns:
  Size of serialized version.
Throws:
  `IgniteCheckedException` - If failed.

#### read

    public static GridCacheVersion read(ByteBuffer buf,
                                        boolean allowNull)
                                 throws IgniteCheckedException

Reads GridCacheVersion instance from the given buffer. Moves buffer's position by the number of used bytes.

Parameters:
  `buf` - Byte buffer.
  `allowNull` - Is `null` version allowed.
Returns:
  Version.
Throws:
  `IgniteCheckedException` - If failed.

#### read

    public static GridCacheVersion read(long pageAddr,
                                        boolean allowNull)
                                 throws IgniteCheckedException

Reads GridCacheVersion instance from the given address.

Parameters:
  `pageAddr` - Page address.
  `allowNull` - Is `null` version allowed.
Returns:
  Version.
Throws:
  `IgniteCheckedException` - If failed.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.0
Release Date | : November 30 2018