From 0effbc7e894710e4f5318ce6491f7abd6dfd9ce0 Mon Sep 17 00:00:00 2001 From: darcy Date: Tue, 7 Feb 2012 17:39:13 -0800 Subject: 7143629: JDK jar/zip code should use unsigned library support Reviewed-by: sherman --- src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/share/demo/nio') diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java index dd15bf87e6..0fab957b37 100644 --- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java +++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipConstants.java @@ -185,11 +185,11 @@ class ZipConstants { */ /////////////////////////////////////////////////////// static final int CH(byte[] b, int n) { - return b[n] & 0xff; + return Byte.toUnsignedInt(b[n]); } static final int SH(byte[] b, int n) { - return (b[n] & 0xff) | ((b[n + 1] & 0xff) << 8); + return Byte.toUnsignedInt(b[n]) | (Byte.toUnsignedInt(b[n + 1]) << 8); } static final long LG(byte[] b, int n) { -- cgit v1.2.3