>When I try to write the integer value to a file using an output stream
>the it only writes the first byte of the pattern so the file just gets
>the 30 and not the B8. I need to be able to send up to 4 bytes at a
>time. I am allowed to extract the bytes if that is possible one at a
>time. The problem is really that I get either 1,2,3, or 4 bytes at a
>time and I can't tell in advance.
For precise binary, you probably want a DataOutputStream or
LEDataOutputStream so you can send out big or little endian groups of
4-bytes. Plain OutputStreams go a byte at a time.
see http://mindprod.com/applets/converter.html for sample code.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.