[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Newcomer: Byte Data Type Conversion



Greg -

Wrap the InputStream in a DataInputStream, then use readInt();

Gregory A. Lusk wrote:

> Hello all,
>
>  
>
> I am reading data into a byte array from an InputStream using the 
> read() method.  I need to be able to read the first byte, which is 
> always a header field containing the total length of the packet, and 
> convert that to an integer value.  Can someone recommend how to do 
> this?  Sorry this question is so elementary.
>
>  
>
> Thanks,
>
>  
>
> Greg Lusk
>
>  
>