protected void readStreamHeader() throws IOException, StreamCorruptedException {
  short s0=bin.readShort();
  short s1=bin.readShort();
  if (s0 != STREAM_MAGIC || s1 != STREAM_VERSION) {
    throw new StreamCorruptedException(String.format("invalid stream header: %04X%04X",s0,s1));
  }
}

protected void readStreamHeader ( ) throws IOException , StreamCorruptedException { short s0 = bin . readShort ( ) ; short s1 = bin . readShort ( ) ; if ( s0 != STREAM_MAGIC || s1 != STREAM_VERSION ) { throw new StreamCorruptedException ( String . format ( "invalid stream header: %04X%04X" , s0 , s1 ) ) ; } }
the readstreamheader method is provided to allow subclasses to read and verify their own stream headers . it reads and verifies the magic number and version number .
