org.apache.ignite.internal.processors.cache

## Class CacheObjectByteArrayImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.CacheObjectByteArrayImpl

All Implemented Interfaces:
  Externalizable, Serializable, CacheObject, Message

    public class CacheObjectByteArrayImpl
    extends Object
    implements CacheObject, Externalizable

Cache object over byte array.

See Also:
  Serialized Form

### Field Summary

Fields
`protected byte[]` `val`

### Fields inherited from interface org.apache.ignite.internal.processors.cache.CacheObject

`TYPE_BINARY, TYPE_BINARY_ENUM, TYPE_BYTE_ARR, TYPE_REGULAR`

### Constructor Summary

Constructors
Constructor and Description
`CacheObjectByteArrayImpl()` Required by `Message`.
`CacheObjectByteArrayImpl(byte[] val)`

### Method Summary

Methods
`byte` `cacheObjectType()`
`byte` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`void` `finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr)`
`boolean` `isPlatformType()` Gets flag indicating whether object value is a platform type.
`void` `onAckReceived()` Method called when ack message received.
`CacheObject` `prepareForCache(CacheObjectContext ctx)` Prepares cache object for cache (e.g. copies user-provided object if needed).
`void` `prepareMarshal(CacheObjectContext ctx)`
`void` `readExternal(ObjectInput in)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`String` `toString()`
`<T> T` `value(CacheObjectContext ctx, boolean cpy)`
`byte[]` `valueBytes(CacheObjectContext ctx)`
`void` `writeExternal(ObjectOutput out)`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

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

### Field Detail

#### val

    protected byte[] val

### Constructor Detail

#### CacheObjectByteArrayImpl

    public CacheObjectByteArrayImpl()

Required by `Message`.

#### CacheObjectByteArrayImpl

    public CacheObjectByteArrayImpl(byte[] val)

Parameters:
  `val` - Value.

### Method Detail

#### finishUnmarshal

    public void finishUnmarshal(CacheObjectContext ctx,
                       ClassLoader ldr)
                         throws IgniteCheckedException

Specified by:
  `finishUnmarshal` in interface `CacheObject`
Parameters:
  `ctx` - Context.
  `ldr` - Class loader.
Throws:
  `IgniteCheckedException` - If failed.

#### value

    @Nullable
    public <T> T value(CacheObjectContext ctx,
                       boolean cpy)

Specified by:
  `value` in interface `CacheObject`
Parameters:
  `ctx` - Context.
  `cpy` - If `true` need to copy value.
Returns:
  Value.

#### valueBytes

    public byte[] valueBytes(CacheObjectContext ctx)
                      throws IgniteCheckedException

Specified by:
  `valueBytes` in interface `CacheObject`
Parameters:
  `ctx` - Context.
Returns:
  Value bytes.
Throws:
  `IgniteCheckedException` - If failed.

#### cacheObjectType

    public byte cacheObjectType()

Specified by:
  `cacheObjectType` in interface `CacheObject`
Returns:
  Object type.

#### isPlatformType

    public boolean isPlatformType()

Gets flag indicating whether object value is a platform type. Platform types will be automatically deserialized on public API cache operations regardless whether `IgniteCache.withKeepBinary()` is used or not.

Specified by:
  `isPlatformType` in interface `CacheObject`
Returns:
  Platform type flag.

#### prepareForCache

    public CacheObject prepareForCache(CacheObjectContext ctx)

Prepares cache object for cache (e.g. copies user-provided object if needed).

Specified by:
  `prepareForCache` in interface `CacheObject`
Parameters:
  `ctx` - Cache context.
Returns:
  Instance to store in cache.

#### prepareMarshal

    public void prepareMarshal(CacheObjectContext ctx)
                        throws IgniteCheckedException

Specified by:
  `prepareMarshal` in interface `CacheObject`
Parameters:
  `ctx` - Context.
Throws:
  `IgniteCheckedException` - If failed.

#### onAckReceived

    public void onAckReceived()

Method called when ack message received.

Specified by:
  `onAckReceived` in interface `Message`

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                  MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                   MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### directType

    public byte directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

Specified by:
  `fieldsCount` in interface `Message`
Returns:
  Fields count.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016