using System; namespace Unplugged.Segy { class FileHeader : IFileHeader { public string Text { get; set; } public FormatCode SampleFormat { get; set; } public bool IsLittleEndian { get; set; } public int SampleNumber { get; set; } public int SampleInteral { get; set; } public int GetValue(int position, int len) { int nDataValue = int.MinValue; if (headerBuffer == null || headerBuffer.Length == 0) { return nDataValue; } if (len == 2) { byte[] bts = new byte[2]; bts[0] = headerBuffer[position + 1]; bts[1] = headerBuffer[position]; nDataValue = BitConverter.ToInt16(bts, 0); // SegyReader.ToInt16(headerBuffer, position, IsLittleEndian); } else if (len == 4) { nDataValue = SegyReader.ToInt32(headerBuffer, position, IsLittleEndian); } return nDataValue; } public byte[] headerBuffer; } }