protected void read(DataInputStream in) { if (in == null) { err("NO input stream!"); } try { signature = FileUtils.getUInt32(in); if (getSignature() != DAT_HEADER_SIGNATURE) { err( "Signature must be " + Long.toHexString(DAT_HEADER_SIGNATURE) + ", but was " + Long.toHexString(getSignature())); } setVersion(FileUtils.getUInt32(in)); headerSize = FileUtils.getUInt32(in); dataSize = FileUtils.getUInt32(in); if (getVersion() == 4) { header = new PGMAcquisitionRegionHeader(); } else if (getVersion() == 3) { header = new PGMAcquisitionHeader(); } else { err("Unknown header version: " + getVersion()); } header.read(in); // p("read header: "+toString()); } catch (IOException ex) { err("Could not read header info of acquisition", ex); } }