/** Reads a box header and sets up for reading contents. */ public void read () throws IOException { length = ModuleBase.readUnsignedInt (dstream, ENDIAN, null); long headerLength = 8; type = read4Chars (); // If the length field is 1, there is an 8-byte extended // length field. if (length == 1) { length = ModuleBase.readSignedLong(dstream, true, null); headerLength = 16; } bytesLeft = length - headerLength; }
/** * Reads 8 bytes from the beginning of the box and parses * out the box length and type. */ public void readHeader () throws IOException { _length = ModuleBase.readUnsignedInt(_dstream, true, _module); _type = _module.read4Chars (_dstream); // If the length field is 1, there is an 8-byte extended // length field. if (_length == 1) { _length = ModuleBase.readSignedLong(_dstream, true, _module); _headerLength = 16; } else { _headerLength = 8; } }