/// <summary> /// Sets the byte collation (byte-swapping method). This is useful if you're reading from a disk stream where bytes are swapped. /// </summary> /// <param name="byte_converter">A WebTVDiskCollationConverter type that descibes the byte collation method we should use.</param> public void set_converter(WebTVDiskCollationConverter byte_converter) { this.byte_converter = byte_converter; }
/// <summary> /// Construcotor. Open a file stream based on a file name. /// </summary> /// <param name="file_name">The full path to the build image file.</param> public WebTVBuildInfo(string file_name) { FileStream build_reader = File.Open(file_name, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); if (build_reader != null) { this.reader = build_reader; var converter = new WebTVDiskCollationConverter(); converter.byte_transform = converter.detect_build_byte_transform(this.reader, 0); this.set_converter(converter); } else { throw new FileLoadException("Couldn't open WebTV build image."); } }