@Override public int decompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) throws MalformedInputException { long inputAddress = ARRAY_BYTE_BASE_OFFSET + inputOffset; long inputLimit = inputAddress + inputLength; long outputAddress = ARRAY_BYTE_BASE_OFFSET + outputOffset; long outputLimit = outputAddress + maxOutputLength; return SnappyRawDecompressor.decompress(input, inputAddress, inputLimit, output, outputAddress, outputLimit); }
public static int getUncompressedLength(byte[] compressed, int compressedOffset) { long compressedAddress = ARRAY_BYTE_BASE_OFFSET + compressedOffset; long compressedLimit = ARRAY_BYTE_BASE_OFFSET + compressed.length; return SnappyRawDecompressor.getUncompressedLength(compressed, compressedAddress, compressedLimit); }
public static int getUncompressedLength(Object compressed, long compressedAddress, long compressedLimit) { return readUncompressedLength(compressed, compressedAddress, compressedLimit)[0]; }
public static int decompress( final Object inputBase, final long inputAddress, final long inputLimit, final Object outputBase, final long outputAddress, final long outputLimit) { // Read the uncompressed length from the front of the input long input = inputAddress; int[] varInt = readUncompressedLength(inputBase, input, inputLimit); int expectedLength = varInt[0]; input += varInt[1]; SnappyInternalUtils.checkArgument(expectedLength <= (outputLimit - outputAddress), "Uncompressed length %s must be less than %s", expectedLength, (outputLimit - outputAddress)); // Process the entire input int uncompressedSize = uncompressAll( inputBase, input, inputLimit, outputBase, outputAddress, outputLimit); if (!(expectedLength == uncompressedSize)) { throw new MalformedInputException(0, String.format("Recorded length is %s bytes but actual length after decompression is %s bytes ", expectedLength, uncompressedSize)); } return expectedLength; }
int bytesRead = 0; int b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result = b & 0x7f; if ((b & 0x80) != 0) { b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result |= (b & 0x7f) << 7; if ((b & 0x80) != 0) { b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result |= (b & 0x7f) << 14; if ((b & 0x80) != 0) { b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result |= (b & 0x7f) << 21; if ((b & 0x80) != 0) { b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result |= (b & 0x7f) << 28;
public static int decompress( final Object inputBase, final long inputAddress, final long inputLimit, final Object outputBase, final long outputAddress, final long outputLimit) { // Read the uncompressed length from the front of the input long input = inputAddress; int[] varInt = readUncompressedLength(inputBase, input, inputLimit); int expectedLength = varInt[0]; input += varInt[1]; SnappyInternalUtils.checkArgument(expectedLength <= (outputLimit - outputAddress), "Uncompressed length %s must be less than %s", expectedLength, (outputLimit - outputAddress)); // Process the entire input int uncompressedSize = uncompressAll( inputBase, input, inputLimit, outputBase, outputAddress, outputLimit); if (!(expectedLength == uncompressedSize)) { throw new MalformedInputException(0, String.format("Recorded length is %s bytes but actual length after decompression is %s bytes ", expectedLength, uncompressedSize)); } return expectedLength; }
int bytesRead = 0; int b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result = b & 0x7f; if ((b & 0x80) != 0) { b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result |= (b & 0x7f) << 7; if ((b & 0x80) != 0) { b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result |= (b & 0x7f) << 14; if ((b & 0x80) != 0) { b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result |= (b & 0x7f) << 21; if ((b & 0x80) != 0) { b = getUnsignedByteSafe(compressed, compressedAddress + bytesRead, compressedLimit); bytesRead++; result |= (b & 0x7f) << 28;
@Override public int decompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) throws MalformedInputException { long inputAddress = ARRAY_BYTE_BASE_OFFSET + inputOffset; long inputLimit = inputAddress + inputLength; long outputAddress = ARRAY_BYTE_BASE_OFFSET + outputOffset; long outputLimit = outputAddress + maxOutputLength; return SnappyRawDecompressor.decompress(input, inputAddress, inputLimit, output, outputAddress, outputLimit); }
public static int getUncompressedLength(byte[] compressed, int compressedOffset) { long compressedAddress = ARRAY_BYTE_BASE_OFFSET + compressedOffset; long compressedLimit = ARRAY_BYTE_BASE_OFFSET + compressed.length; return SnappyRawDecompressor.getUncompressedLength(compressed, compressedAddress, compressedLimit); }
public static int getUncompressedLength(Object compressed, long compressedAddress, long compressedLimit) { return readUncompressedLength(compressed, compressedAddress, compressedLimit)[0]; }
int written = SnappyRawDecompressor.decompress(inputBase, inputAddress, inputLimit, outputBase, outputAddress, outputLimit); output.position(output.position() + written);
int written = SnappyRawDecompressor.decompress(inputBase, inputAddress, inputLimit, outputBase, outputAddress, outputLimit); output.position(output.position() + written);