class SnappyCompressor {

  public byte[] compress(final byte[] uncompressed) {
    checkNotNull(uncompressed, "input data must not be null");
    try {
      return Snappy.compress(uncompressed);
    } catch (final IOException e) {
      throw new FramingException("Snappy compression failed", e);
    }
  }

}