public static void checkSignature(DataInput dataInput) throws IOException {
  if (dataInput.readInt() != SIGNATURE1 || dataInput.readInt() != SIGNATURE2) {
    throw new IllegalStateException("Signature bytes do not match");
  }
}

public static void checkSignature ( DataInput dataInput ) throws IOException { if ( dataInput . readInt ( ) != SIGNATURE1 || dataInput . readInt ( ) != SIGNATURE2 ) { throw new IllegalStateException ( "Signature bytes do not match" ) ; } }
check the signature of a data source
