We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorry, but how can I decompress Framed Format files?
The text was updated successfully, but these errors were encountered:
public static void main(String[] args) throws IOException { FileInputStream file = new FileInputStream("DataList.txt"); byte[] compressed = compressFrame(file.readAllBytes()); for (byte b: compressed) { System.out.print(b + " "); } byte[] decompressed = uncompressFrames(compressFrame(input)); **//why null?** } public static byte[] compressFrame(byte[] input) throws IOException { try(ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(input.length)) { try(SnappyFramedOutputStream snappyFramedOutputStream = new SnappyFramedOutputStream(byteArrayOutputStream)) { snappyFramedOutputStream.write(input); snappyFramedOutputStream.flush(); return byteArrayOutputStream.toByteArray(); } } } public static byte[] uncompressFrames(byte[] input) throws IOException { try(ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(input)) { try(SnappyFramedInputStream snappyFramedInputStream = new SnappyFramedInputStream(byteArrayInputStream, false)) { try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) { snappyFramedInputStream.transferTo(byteArrayOutputStream); return byteArrayInputStream.readAllBytes(); } } } }
Sorry, something went wrong.
No branches or pull requests
Sorry, but how can I decompress Framed Format files?
The text was updated successfully, but these errors were encountered: