private static byte[] compressBytes(RegionEntryContext context, byte[] uncompressedBytes) {
    byte[] result = uncompressedBytes;
    if (isCompressible(context, uncompressedBytes)) {
      long time = context.getCachePerfStats().startCompression();
      result = context.getCompressor().compress(uncompressedBytes);
      context.getCachePerfStats().endCompression(time, uncompressedBytes.length, result.length);
    }
    return result;
  }
This method determines if the value is compressible and compresses it if it is.

@param context the values context.
@param value a region entry value.

@return the compressed form of the value parameter.
geode-core/src/main/java/org/apache/geode/internal/cache/entries/AbstractRegionEntry.java