com.esotericsoftware.kryo.compress
Class ByteArrayCompressor

java.lang.Object
  extended by com.esotericsoftware.kryo.Serializer
      extended by com.esotericsoftware.kryo.Compressor
          extended by com.esotericsoftware.kryo.compress.ByteArrayCompressor
Direct Known Subclasses:
DeflateCompressor, StreamCompressor

public abstract class ByteArrayCompressor
extends Compressor

Convenience class to compress and decompress using byte arrays.

Author:
Nathan Sweet

Field Summary
 
Fields inherited from class com.esotericsoftware.kryo.Compressor
bufferSize
 
Constructor Summary
ByteArrayCompressor(Serializer serializer)
           
ByteArrayCompressor(Serializer serializer, int bufferSize)
           
 
Method Summary
abstract  void compress(byte[] inputBytes, int inputLength, java.nio.ByteBuffer outputBuffer)
          Implementations should read the specified number of input bytes and write compressed data to the output buffer.
 void compress(java.nio.ByteBuffer inputBuffer, java.lang.Object object, java.nio.ByteBuffer outputBuffer)
          The compressor should read the input buffer from the current position to the limit, compress the data, and put the result in the output buffer.
abstract  void decompress(byte[] inputBytes, int inputLength, java.nio.ByteBuffer outputBuffer)
          Implementations should read the specified number of input bytes and write decompressed data to the output bytes.
 void decompress(java.nio.ByteBuffer inputBuffer, java.lang.Class type, java.nio.ByteBuffer outputBuffer)
          The compressor should read the input buffer from the current position to the limit, decompress the data, and put the result in the output buffer.
 
Methods inherited from class com.esotericsoftware.kryo.Compressor
readObjectData, setCompress, setDecompress, writeObjectData
 
Methods inherited from class com.esotericsoftware.kryo.Serializer
isFinal, newInstance, readObject, setCanBeNull, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayCompressor

public ByteArrayCompressor(Serializer serializer)

ByteArrayCompressor

public ByteArrayCompressor(Serializer serializer,
                           int bufferSize)
Method Detail

compress

public void compress(java.nio.ByteBuffer inputBuffer,
                     java.lang.Object object,
                     java.nio.ByteBuffer outputBuffer)
Description copied from class: Compressor
The compressor should read the input buffer from the current position to the limit, compress the data, and put the result in the output buffer.

Specified by:
compress in class Compressor
outputBuffer - A non-direct buffer.

compress

public abstract void compress(byte[] inputBytes,
                              int inputLength,
                              java.nio.ByteBuffer outputBuffer)
Implementations should read the specified number of input bytes and write compressed data to the output buffer.

Parameters:
outputBuffer - A non-direct buffer.

decompress

public void decompress(java.nio.ByteBuffer inputBuffer,
                       java.lang.Class type,
                       java.nio.ByteBuffer outputBuffer)
Description copied from class: Compressor
The compressor should read the input buffer from the current position to the limit, decompress the data, and put the result in the output buffer.

Specified by:
decompress in class Compressor
outputBuffer - A non-direct buffer.

decompress

public abstract void decompress(byte[] inputBytes,
                                int inputLength,
                                java.nio.ByteBuffer outputBuffer)
Implementations should read the specified number of input bytes and write decompressed data to the output bytes.

Parameters:
outputBuffer - A non-direct buffer.


Copyright © 2011. All Rights Reserved.