Can anyone please point me toward a way to unpack network packed data?
My goal is to create the interface to to read a 32 Byte Header followed by a zipped payload of varying sizes...
The Header has a format:
char  timestamp
int  data type (1=heartbeat, 2=XML)
int  sequence number
int  compressed payload size
int  uncompressed payload size.
Please note I can see the timestamp, datatype, and sequence number fine and reliably.
The compressed and uncompressed fields appear to be Network packed data and I see binary data when I try to print the fields. I need the compressed/uncompressed size to know how much data to read for the payload and how big it should unzip too.
NOTE: in perl I have this working with no problem with "unpack(N*", but Java is killing me. I am a newbie... Maybe I should have opened with that.
I use a socketchannel and I read the header into a byte buffer.