ZsyncUtil { public static short unsigned(byte b) { return (short) (b < 0 ? b & 0xFF : b); }  static String toHexString(ByteBuffer buffer); static int computeRsum(byte[] block); static int toInt(short x, short y); static long toLong(int x, int y); static short unsigned(byte b); static String computeSha1(ReadableByteChannel channel); static MessageDigest newMD4(); static MessageDigest newSHA1(); static Path getPath(URI uri);  }
@Test public void testUnsignedNegative() { assertEquals((short) 255, ZsyncUtil.unsigned((byte) -1)); }
@Test public void testUnsignedPositive() { assertEquals((short) 1, ZsyncUtil.unsigned((byte) 1)); }