private string LoadString(ImageLibOffset location) { if (location == null) { return(null); } return(Encoding.GetEncoding(1252).GetString(LoadBytes(location))); }
public ImageLibItem(string filename, bool hidden, ImageLibOffset title, ImageLibOffset description, ImageLibOffset thumbnail, ImageLibOffset huge, FileInfo libFile) { Filename = filename; Hidden = hidden; _title = title; _description = description; _thumbnail = thumbnail; _huge = huge; _libFile = libFile; }
private byte[] LoadBytes(ImageLibOffset location) { if (location == null) { return(null); } using (BinaryReader reader = new BinaryReader(_libFile.OpenRead())) { reader.BaseStream.Seek(location.Offset, SeekOrigin.Begin); return(reader.ReadBytes(location.Length)); } }