org.apache.ignite.internal.portable.streams

## Class PortableMemoryAllocatorChunk

- java.lang.Object
- - org.apache.ignite.internal.portable.streams.PortableMemoryAllocatorChunk

    public class PortableMemoryAllocatorChunk
    extends Object

Memory allocator chunk.

### Field Summary

Fields
`protected static long` `BYTE_ARR_OFF` Array offset: byte.
`protected static sun.misc.Unsafe` `UNSAFE` Unsafe instance.

### Constructor Summary

Constructors
Constructor and Description
`PortableMemoryAllocatorChunk()`

### Method Summary

Methods
`byte[]` `allocate(int size)` Allocate.
`boolean` `isAcquired()`
`byte[]` `reallocate(byte[] data, int size)` Reallocate.
`void` `release(byte[] data, int maxMsgSize)` Shrinks array size if needed.

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

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

### Field Detail

#### UNSAFE

    protected static final sun.misc.Unsafe UNSAFE

Unsafe instance.

#### BYTE_ARR_OFF

    protected static final long BYTE_ARR_OFF

Array offset: byte.

### Constructor Detail

#### PortableMemoryAllocatorChunk

    public PortableMemoryAllocatorChunk()

### Method Detail

#### allocate

    public byte[] allocate(int size)

Allocate.

Parameters:
  `size` - Desired size.
Returns:
  Data.

#### reallocate

    public byte[] reallocate(byte[] data,
                    int size)

Reallocate.

Parameters:
  `data` - Old data.
  `size` - Size.
Returns:
  New data.

#### release

    public void release(byte[] data,
               int maxMsgSize)

Shrinks array size if needed.

#### isAcquired

    public boolean isAcquired()

Returns:
  `True` if acquired.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0-b1
Release Date | : December 1 2015