Skip to content

Commit

Permalink
don't unread when nothing was read
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode authored and gnodet committed Oct 20, 2022
1 parent 0841ec3 commit b4f0826
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ public boolean hasZipHeader() throws IOException
{
final byte[] header = new byte[HEADER_LEN];
int len = super.read( header, 0, HEADER_LEN );
super.unread( header, 0, len );
if ( len != -1 )
{
super.unread( header, 0, len );
}
return Arrays.equals( header, ZIP_HEADER );
}
}
Expand Down

0 comments on commit b4f0826

Please sign in to comment.