public byte[] inflate(byte[] data) throws IOException { return LZFDecoder.decode(data); } }
public static int safeDecode(final byte[] sourceBuffer, int offset, int length, final byte[] targetBuffer) throws LZFException { return safeDecoder().decode(sourceBuffer, offset, length, targetBuffer); } }
public static int decode(final byte[] sourceBuffer, int offset, int length, final byte[] targetBuffer) throws LZFException { return fastDecoder().decode(sourceBuffer, offset, length, targetBuffer); }
public static int safeDecode(final byte[] sourceBuffer, int offset, int length, final byte[] targetBuffer) throws LZFException { return safeDecoder().decode(sourceBuffer, offset, length, targetBuffer); } }
public static int decode(final byte[] sourceBuffer, int offset, int length, final byte[] targetBuffer) throws LZFException { return fastDecoder().decode(sourceBuffer, offset, length, targetBuffer); }
@Override public void decompress(ByteBuffer in, int numBytes, ByteBuffer out) { final byte[] bytes = new byte[numBytes]; in.get(bytes); try (final ResourceHolder<byte[]> outputBytesHolder = CompressedPools.getOutputBytes()) { final byte[] outputBytes = outputBytesHolder.get(); final int numDecompressedBytes = LZFDecoder.decode(bytes, outputBytes); out.put(outputBytes, 0, numDecompressedBytes); out.flip(); } catch (IOException e) { throw new RuntimeException(e); } }
public static byte[] safeDecode(final byte[] inputBuffer, int offset, int length) throws LZFException { return safeDecoder().decode(inputBuffer, offset, length); }
public static byte[] decode(final byte[] inputBuffer) throws LZFException { return fastDecoder().decode(inputBuffer, 0, inputBuffer.length); }
private int _handleFiles(File dir) throws IOException { System.out.println("Testing files from dir '" + dir.getAbsolutePath() + "'..."); int count = 0; for(File f: dir.listFiles()) { if(f.isDirectory()) { count += _handleFiles(f); } else { byte[] data = _readData(f); byte[] enc = LZFEncoder.encode(data); byte[] dec = LZFDecoder.decode(enc); assertArrayEquals("File '" + f.getAbsolutePath() + "'", data, dec); ++count; } } return count; }
public static int safeDecode(final byte[] inputBuffer, final byte[] targetBuffer) throws LZFException { return safeDecoder().decode(inputBuffer, 0, inputBuffer.length, targetBuffer); }
public static int decode(final byte[] inputBuffer, final byte[] targetBuffer) throws LZFException { return fastDecoder().decode(inputBuffer, 0, inputBuffer.length, targetBuffer); }
public void fromBytes(ImmutableBytesWritable bytes) { try { uncompressed = LZFDecoder.decode(bytes.get(), bytes.getOffset(), bytes.getLength()); } catch (IOException e) { throw new RuntimeException("LZF decode failure", e); } size = cap = uncompressed.length / valueLen; compressed = BytesUtil.EMPTY_BYTE_ARRAY; // mark closed }
public static int safeDecode(final byte[] inputBuffer, final byte[] targetBuffer) throws LZFException { return safeDecoder().decode(inputBuffer, 0, inputBuffer.length, targetBuffer); }
public static int decode(final byte[] sourceBuffer, int offset, int length, final byte[] targetBuffer) throws LZFException { return fastDecoder().decode(sourceBuffer, offset, length, targetBuffer); }
@Test public void test() throws IOException { byte[] raw = new byte[] { 1, 2, 3, 3, 2, 23 }; byte[] data = LZFEncoder.encode(raw); byte[] data2 = new byte[data.length * 2]; java.lang.System.arraycopy(data, 0, data2, 0, data.length); ImmutableBytesWritable bytes = new ImmutableBytesWritable(); bytes.set(data2, 0, data.length); try { byte[] uncompressed = LZFDecoder.decode(bytes.get(), bytes.getOffset(), bytes.getLength()); } catch (IOException e) { throw new RuntimeException("LZF decode failure", e); } } }
public static int safeDecode(final byte[] sourceBuffer, int offset, int length, final byte[] targetBuffer) throws LZFException { return safeDecoder().decode(sourceBuffer, offset, length, targetBuffer); } }
public static byte[] decode(final byte[] inputBuffer) throws LZFException { return fastDecoder().decode(inputBuffer, 0, inputBuffer.length); }
public static byte[] decompress(byte[] in) throws IOException { return LZFDecoder.decode(in); }
public static byte[] safeDecode(final byte[] inputBuffer, int offset, int length) throws LZFException { return safeDecoder().decode(inputBuffer, offset, length); }
public static byte[] decode(final byte[] inputBuffer) throws LZFException { return fastDecoder().decode(inputBuffer, 0, inputBuffer.length); }