private static Date readDate(DataInput dataInput) throws IOException {
  if (dataInput.readInt() != 5) {
    throw new IllegalStateException("Date must be 5 bytes");
  }
  byte[] buffer=new byte[5];
  dataInput.readFully(buffer);
  return unpackDate(buffer);
}

private static Date readDate ( DataInput dataInput ) throws IOException { if ( dataInput . readInt ( ) != 5 ) { throw new IllegalStateException ( "Date must be 5 bytes" ) ; } byte [ ] buffer = new byte [ 5 ] ; dataInput . readFully ( buffer ) ; return unpackDate ( buffer ) ; }
utility methods to read and consume from the stream according to the data type we need .
