Add isValidCompressedBuffer for raw memory addresses

This commit is contained in:
Taro L. Saito 2013-08-13 17:02:16 +09:00
parent fed7278fcd
commit ae0a3e4d49
1 changed files with 11 additions and 0 deletions

View File

@ -320,6 +320,17 @@ public class Snappy
compressed.remaining());
}
/**
* Returns true iff the contents of compressed buffer [offset,
* offset+length) can be uncompressed successfully. Does not return the
* uncompressed data. Takes time proportional to the input length, but is
* usually at least a factor of four faster than actual decompression.
*/
public static boolean isValidCompressedBuffer(long inputAddr, long offset, long length) throws IOException {
return impl.isValidCompressedBuffer(inputAddr, offset, length);
}
/**
* Get the maximum byte size needed for compressing data of the given byte
* size.