Bitwise and Bit Shift Operators ~ Unary bitwise complement << Signed left shift >> Signed right shift >>> Unsigned right shift & Bitwise AND ^ Bitwise exclusive OR | Bitwise inclusive OR byte 1 signed byte (two's complement). Covers values from -128 to 127. short 2 bytes, signed (two's complement), -32,768 to 32,767 int 4 bytes, signed (two's complement). -2,147,483,648 to 2,147,483,647. Like all numeric types ints may be cast into other numeric types (byte, short, long, float, double). When lossy casts are done (e.g. int to byte) the conversion is done modulo the length of the smaller type. long 8 bytes signed (two's complement). Ranges from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807. int to byte and byte to int =========================== int width = 400; byte [] data = new byte [4]; data[0] = (byte) width; data[1] = (byte) (width >>> 8); data[2] = (byte) (width >>> 16); data[3] = (byte) (width >>> 24); width = (data[0]<<0)&0xff | (data[1]<<8)&0xff00 | (data[2]<<16)&0xff0000 | (data[3]<<24)&0xff000000; Byte objects // create 2 Byte objects b1, b2 Byte b1, b2; // create 2 int i1, i2 int i1, i2; // assign values to b1, b2 b1 = new Byte("123"); b2 = new Byte("-32"); // assign int values of b1, b2 to i1, i2 i1 = b1.intValue(); i2 = b2.intValue(); BigInteger(byte[] val) Translates a byte array containing the two's-complement binary representation of a BigInteger into a BigInteger. byte[] toByteArray() Returns a byte array containing the two's-complement representation of this BigInteger.