public class BytesBlock extends Object implements Serializable
Byte array implementing custom
Serializable techniques. Moreover, some types of compression are
allowed in these processes.| Modifier and Type | Field and Description |
|---|---|
static int |
BEST_COMPRESSION |
static int |
BEST_SPEED |
static int |
DEFAULT_COMPRESSION |
static int |
HUFFMAN_ONLY |
static int |
NO_COMPRESSION |
long |
serializationFinalTime |
long |
serializationStartTime |
| Constructor and Description |
|---|
BytesBlock(byte[] byteArray)
Builds a
BytesBlock with parameter byteArray. |
BytesBlock(byte[] byteArray,
int compressionLevel)
Builds a
BytesBlock from an Byte Array. |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
compressionBytes(byte[] bytesToCompress,
int compressionLevel) |
protected byte[] |
decompressionBytes(byte[] bytesToDecompress) |
boolean |
equals(Object object)
If byte array is equals in both compared objects returns true.
|
byte[] |
getBytes() |
public static final int NO_COMPRESSION
public static final int BEST_COMPRESSION
public static final int BEST_SPEED
public static final int DEFAULT_COMPRESSION
public static final int HUFFMAN_ONLY
public long serializationStartTime
public long serializationFinalTime
public BytesBlock(byte[] byteArray)
BytesBlock with parameter byteArray.
Serialization will be executed with default method (with compression).
Moreover, object will determine itself if byteArray
compression is justified.byteArray - the byte arraypublic BytesBlock(byte[] byteArray,
int compressionLevel)
BytesBlock from an Byte Array. Serialization will
be executed with default method and without compression (NO_COMPRESSION).
If in parameter compressionLevel is passed NO_COMPRESSION,
this constructor will be equivalent to BytesBlock(byte[]).
When an object is serialized to disk, NO_COMPRESSION is about twenty times better in performance than Compression. However, when serialization is executed over RMI, generally results are inverted.
byteArray - the byte arraycompressionLevel - Indicates the level of compression is defined in this class
according to DeflaterCopyright © 2016 Imatia Innovation S.L.. All rights reserved.