Skip to content
New issue

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

Question: java.lang.NegativeArraySizeException for Large files. #278

Open
AbhishekPowar opened this issue Mar 15, 2021 · 0 comments
Open

Comments

@AbhishekPowar
Copy link

AbhishekPowar commented Mar 15, 2021

I had this error while I tried to decompress a large file.
Size of sample.snappy is 10 GB. Is there a way around it.

Code source : Source

String fileName = "sample.snappy";
SnappyInputStream sis = new SnappyInputStream(new FileInputStream(fileName));
byte[] buffer = new byte[4096];
int len = 0;
while ((len = sis.read(buffer)) != -1) {
    System.out.println(new String(buffer, 0, len));
}

Error Log:

Exception in thread "main" java.lang.NegativeArraySizeException
        at org.xerial.snappy.SnappyInputStream.readFully(SnappyInputStream.java:116)
        at org.xerial.snappy.SnappyInputStream.readHeader(SnappyInputStream.java:88)
        at org.xerial.snappy.SnappyInputStream.<init>(SnappyInputStream.java:58)

Let me know if this post doesn't belong here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants