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

HADOOP-19292. Don't create new EOFException in BlockDecompressorStream #7090

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected int getCompressedData() throws IOException {
while (n < len) {
int count = in.read(buffer, off + n, len - n);
if (count < 0) {
throw new EOFException("Unexpected end of block in input stream");
throw EOF_EXCEPTION;
}
n += count;
}
Expand All @@ -141,13 +141,15 @@ public void resetState() throws IOException {
super.resetState();
}

private static final EOFException EOF_EXCEPTION = new EOFException("EOF in BlockDecompressorStream");

private int rawReadInt() throws IOException {
int b1 = in.read();
int b2 = in.read();
int b3 = in.read();
int b4 = in.read();
if ((b1 | b2 | b3 | b4) < 0)
throw new EOFException();
throw EOF_EXCEPTION;
return ((b1 << 24) + (b2 << 16) + (b3 << 8) + (b4 << 0));
}
}
Loading