private ItemElement ReadItem(ExtendedBinaryReader input) { var offset = input.ReadUInt16(); var returnPos = input.Position; input.Seek(offset, SeekOrigin.Begin); var title = ReadSubtitle(input); var description = ReadSubtitle(input); var item = new ItemElement { Title = title, Description = description }; input.Seek(returnPos, SeekOrigin.Begin); return(item); }
private long WriteItem(ExtendedBinaryWriter output, IList <Subtitle> subtitles, ItemElement item, long outputOffset) { output.Write((ushort)outputOffset); var returnPos = output.Position; output.Seek(outputOffset, SeekOrigin.Begin); var subtitle = subtitles.First(x => x.Offset == item.Title.Offset); var currentOffset = outputOffset + 4; currentOffset = WriteSubtitle(output, subtitle, currentOffset, true); subtitle = subtitles.First(x => x.Offset == item.Description.Offset); currentOffset = WriteSubtitle(output, subtitle, currentOffset, true); output.Seek(returnPos, SeekOrigin.Begin); return(currentOffset); }