org.apache.ignite.binary

## Interface BinaryReader

-     public interface BinaryReader

  Reader for binary objects used in `Binarylizable` implementations. Useful for the cases when user wants a fine-grained control over serialization.

  Note that Ignite never writes full strings for field or type names. Instead, for performance reasons, Ignite writes integer hash codes for type and field names. It has been tested that hash code conflicts for the type names or the field names within the same type are virtually non-existent and, to gain performance, it is safe to work with hash codes. For the cases when hash codes for different types or fields actually do collide, Ignite provides `BinaryIdMapper` which allows to override the automatically generated hash code IDs for the type and field names.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `BinaryRawReader` | `rawReader()` Gets raw reader.
    `boolean` | `readBoolean(String fieldName)`
    `boolean[]` | `readBooleanArray(String fieldName)`
    `byte` | `readByte(String fieldName)`
    `byte[]` | `readByteArray(String fieldName)`
    `char` | `readChar(String fieldName)`
    `char[]` | `readCharArray(String fieldName)`
    `<T> Collection<T>` | `readCollection(String fieldName)`
    `<T> Collection<T>` | `readCollection(String fieldName, BinaryCollectionFactory<T> factory)`
    `Date` | `readDate(String fieldName)`
    `Date[]` | `readDateArray(String fieldName)`
    `BigDecimal` | `readDecimal(String fieldName)`
    `BigDecimal[]` | `readDecimalArray(String fieldName)`
    `double` | `readDouble(String fieldName)`
    `double[]` | `readDoubleArray(String fieldName)`
    `<T extends Enum<?>> T` | `readEnum(String fieldName)`
    `<T extends Enum<?>> T[]` | `readEnumArray(String fieldName)`
    `float` | `readFloat(String fieldName)`
    `float[]` | `readFloatArray(String fieldName)`
    `int` | `readInt(String fieldName)`
    `int[]` | `readIntArray(String fieldName)`
    `long` | `readLong(String fieldName)`
    `long[]` | `readLongArray(String fieldName)`
    `<K,V> Map<K,V>` | `readMap(String fieldName)`
    `<K,V> Map<K,V>` | `readMap(String fieldName, BinaryMapFactory<K,V> factory)`
    `<T> T` | `readObject(String fieldName)`
    `Object[]` | `readObjectArray(String fieldName)`
    `short` | `readShort(String fieldName)`
    `short[]` | `readShortArray(String fieldName)`
    `String` | `readString(String fieldName)`
    `String[]` | `readStringArray(String fieldName)`
    `Time` | `readTime(String fieldName)`
    `Time[]` | `readTimeArray(String fieldName)`
    `Timestamp` | `readTimestamp(String fieldName)`
    `Timestamp[]` | `readTimestampArray(String fieldName)`
    `UUID` | `readUuid(String fieldName)`
    `UUID[]` | `readUuidArray(String fieldName)`

- - ### Method Detail

    - #### readByte

          byte readByte(String fieldName)
                 throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Byte value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readShort

          short readShort(String fieldName)
                   throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Short value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readInt

          int readInt(String fieldName)
               throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Integer value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readLong

          long readLong(String fieldName)
                 throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Long value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readFloat

          float readFloat(String fieldName)
                   throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Float value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readDouble

          double readDouble(String fieldName)
                     throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Double value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readChar

          char readChar(String fieldName)
                 throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Char value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readBoolean

          boolean readBoolean(String fieldName)
                       throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Boolean value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readDecimal

          BigDecimal readDecimal(String fieldName)
                          throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Decimal value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readString

          String readString(String fieldName)
                     throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        String value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readUuid

          UUID readUuid(String fieldName)
                 throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        UUID.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readDate

          Date readDate(String fieldName)
                 throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Date.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readTimestamp

          Timestamp readTimestamp(String fieldName)
                           throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Timestamp.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readTime

          Time readTime(String fieldName)
                 throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Time.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readObject

          <T> T readObject(String fieldName)
                    throws BinaryObjectException

      Type Parameters:
        `T` - Type of the read object.
      Parameters:
        `fieldName` - Field name.
      Returns:
        Object.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readByteArray

          byte[] readByteArray(String fieldName)
                        throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Byte array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readShortArray

          short[] readShortArray(String fieldName)
                          throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Short array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readIntArray

          int[] readIntArray(String fieldName)
                      throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Integer array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readLongArray

          long[] readLongArray(String fieldName)
                        throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Long array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readFloatArray

          float[] readFloatArray(String fieldName)
                          throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Float array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readDoubleArray

          double[] readDoubleArray(String fieldName)
                            throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Byte array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readCharArray

          char[] readCharArray(String fieldName)
                        throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Char array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readBooleanArray

          boolean[] readBooleanArray(String fieldName)
                              throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Boolean array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readDecimalArray

          BigDecimal[] readDecimalArray(String fieldName)
                                 throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Decimal array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readStringArray

          String[] readStringArray(String fieldName)
                            throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        String array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readUuidArray

          UUID[] readUuidArray(String fieldName)
                        throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        UUID array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readDateArray

          Date[] readDateArray(String fieldName)
                        throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Date array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readTimestampArray

          Timestamp[] readTimestampArray(String fieldName)
                                  throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Timestamp array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readTimeArray

          Time[] readTimeArray(String fieldName)
                        throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Time array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readObjectArray

          Object[] readObjectArray(String fieldName)
                            throws BinaryObjectException

      Parameters:
        `fieldName` - Field name.
      Returns:
        Object array.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readCollection

          <T> Collection<T> readCollection(String fieldName)
                                    throws BinaryObjectException

      Type Parameters:
        `T` - Type of elements in collection to read.
      Parameters:
        `fieldName` - Field name.
      Returns:
        Collection.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readCollection

          <T> Collection<T> readCollection(String fieldName,
                                           BinaryCollectionFactory<T> factory)
                                    throws BinaryObjectException

      Type Parameters:
        `T` - Type of elements in collection to read.
      Parameters:
        `fieldName` - Field name.
        `factory` - Collection factory.
      Returns:
        Collection.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readMap

          <K,V> Map<K,V> readMap(String fieldName)
                          throws BinaryObjectException

      Type Parameters:
        `K` - Type of keys in the map to read.
        `V` - Type of mapped values in the map to read.
      Parameters:
        `fieldName` - Field name.
      Returns:
        Map.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readMap

          <K,V> Map<K,V> readMap(String fieldName,
                                 BinaryMapFactory<K,V> factory)
                          throws BinaryObjectException

      Type Parameters:
        `K` - Type of keys in the map to read.
        `V` - Type of mapped values in the map to read.
      Parameters:
        `fieldName` - Field name.
        `factory` - Map factory.
      Returns:
        Map.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readEnum

          <T extends Enum<?>> T readEnum(String fieldName)
                                  throws BinaryObjectException

      Type Parameters:
        `T` - Type of the enum to read.
      Parameters:
        `fieldName` - Field name.
      Returns:
        Value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### readEnumArray

          <T extends Enum<?>> T[] readEnumArray(String fieldName)
                                         throws BinaryObjectException

      Type Parameters:
        `T` - Type of the enum values in array to read.
      Parameters:
        `fieldName` - Field name.
      Returns:
        Value.
      Throws:
        `BinaryObjectException` - In case of error.

    - #### rawReader

          BinaryRawReader rawReader()

      Gets raw reader. Raw reader does not use field name hash codes, therefore, making the format even more compact. However, if the raw reader is used, dynamic structure changes to the binary objects are not supported.
      Returns:
        Raw reader.

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022