Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.util
Class ExternalizableHelper.FormatAwareCompressor

java.lang.Object
  extended by com.tangosol.util.ExternalizableHelper.FormatAwareCompressor

All Implemented Interfaces:
com.tangosol.io.DeltaCompressor
Enclosing class:
ExternalizableHelper

public static class ExternalizableHelper.FormatAwareCompressor
extends java.lang.Object
implements com.tangosol.io.DeltaCompressor

A DeltaCompressor wrapper implementation that removes/replaces the serialization format byte (FMT_EXT) before/after delegating to the underlying compressor.


Field Summary
protected  com.tangosol.io.DeltaCompressor m_compressor
          The wrapped DeltaCompressor.

 

Constructor Summary
ExternalizableHelper.FormatAwareCompressor(com.tangosol.io.DeltaCompressor compressor)
          Construct a FormatAwareCompressor.

 

Method Summary
 com.tangosol.io.ReadBuffer applyDelta(com.tangosol.io.ReadBuffer bufOld, com.tangosol.io.ReadBuffer bufDelta)
          Apply a delta to an old value in order to create a new value.
 com.tangosol.io.ReadBuffer extractDelta(com.tangosol.io.ReadBuffer bufOld, com.tangosol.io.ReadBuffer bufNew)
          Compare an old value to a new value and generate a delta that represents the changes that must be made to the old value in order to transform it into the new value.
 java.lang.String toString()
          Returns a string representation of the object.

 

Field Detail

m_compressor

protected com.tangosol.io.DeltaCompressor m_compressor
The wrapped DeltaCompressor.

Constructor Detail

ExternalizableHelper.FormatAwareCompressor

public ExternalizableHelper.FormatAwareCompressor(com.tangosol.io.DeltaCompressor compressor)
Construct a FormatAwareCompressor.
Parameters:
compressor - the underlying compressor

Method Detail

extractDelta

public com.tangosol.io.ReadBuffer extractDelta(com.tangosol.io.ReadBuffer bufOld,
                                               com.tangosol.io.ReadBuffer bufNew)
Compare an old value to a new value and generate a delta that represents the changes that must be made to the old value in order to transform it into the new value. The generated delta must be a ReadBuffer of non-zero length.

If the old value is null, the generated delta must be a "replace", meaning that applying it to any value must produce the specified new value.

Specified by:
extractDelta in interface com.tangosol.io.DeltaCompressor
Parameters:
bufOld - the old value
bufNew - the new value; must not be null
Returns:
the changes that must be made to the old value in order to transform it into the new value, or null to indicate no change

applyDelta

public com.tangosol.io.ReadBuffer applyDelta(com.tangosol.io.ReadBuffer bufOld,
                                             com.tangosol.io.ReadBuffer bufDelta)
Apply a delta to an old value in order to create a new value.
Specified by:
applyDelta in interface com.tangosol.io.DeltaCompressor
Parameters:
bufOld - the old value
bufDelta - the delta information returned from extractDelta(com.tangosol.io.ReadBuffer, com.tangosol.io.ReadBuffer) to apply to the old value
Returns:
the new value

toString

public java.lang.String toString()
Returns a string representation of the object.
Returns:
a string representation of the object

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.