How can I use an unsigned 'byte' (so it reaches 255 but is still 1 byte)

I'm doing some compression programmes for school. I've done a framework and now I'm implementing the algorithms.

My problem is that I need to work on bytes (I user array of bytes for IO purposes) and after all was developing nicely, I discovered that byte is signed and I can't do something like

byte pivot |= 128;

I neeed this because I use a vector containing "1" and "0"s that represent my coded symbol and I must apply this to a byte value.

[475 byte] By [Teo_Ga] at [2007-10-2 5:39:15]
# 1
You could allways use ints instead of bytes.For the IO you could allways convert from one to another.
jfbrierea at 2007-7-16 1:49:35 > top of Java-index,Java Essentials,Java Programming...
# 2
May be usebyte pivot |= (byte) 0x80;
atmguya at 2007-7-16 1:49:35 > top of Java-index,Java Essentials,Java Programming...
# 3
or just byte pivot |= (byte) 128. :-)
atmguya at 2007-7-16 1:49:35 > top of Java-index,Java Essentials,Java Programming...