// Overwrite the box'field header with a new header incorporating a size // change. public virtual void OverwriteHeader(long sizeChange) { // If we don'type have a header we can'type do anything. if (header == null || header.Position < 0) { TagLibDebugger.Debug("Box.OverWriteHeader() - No header to overwrite."); return; } // Make sure this alteration won'type screw up the reading of children. LoadChildren(); // Save the header'field original position and size. long position = header.Position; long oldSize = header.HeaderSize; // Update the data size. header.DataSize = (ulong)((long)header.DataSize + sizeChange); // Render the header onto the file. File.Insert(header.Render(), position, oldSize); }
public void UpdateOffset(int sizeDifference) { ByteVector newData = UpdateOffsetInternal(sizeDifference); File.Insert(newData, DataPosition, newData.Count); }