/** Creates a new instance of BaseTable */ protected BaseTable(DirectoryEntry de, DataInput di) throws IOException { _de = (DirectoryEntry) de.clone(); // Load entire table into a buffer, and create another input stream _buf = new byte[de.getLength()]; di.readFully(_buf); DataInput di2 = getDataInputForOffset(0); _version = di2.readInt(); _horizAxisOffset = di2.readUnsignedShort(); _vertAxisOffset = di2.readUnsignedShort(); if (_horizAxisOffset != 0) { _horizAxis = new Axis(_horizAxisOffset); } if (_vertAxisOffset != 0) { _vertAxis = new Axis(_vertAxisOffset); } // Let go of the buffer _buf = null; }
protected FpgmTable(DirectoryEntry de, RandomAccessFileEmulator raf) throws IOException { raf.seek(de.getOffset()); readInstructions(raf, de.getLength()); }
private DataInput getDataInputForOffset(int offset) { return new DataInputStream(new ByteArrayInputStream(_buf, offset, _de.getLength() - offset)); }