public static DataRecordLeader FromStream( BinaryReader reader ) { char[] leaderData = reader.ReadChars(24); var leader = new DataRecordLeader(); leader.RecordLength = int.Parse( new string( leaderData, 0, 5 ) ); leader.LeaderType = TypeFromChar( leaderData[ 6 ] ); LoadFieldArea( leaderData, leader ); return leader; }
public void SetUp() { using( FileStream stream = new FileStream( "BD01CATD.DDF", FileMode.Open ) ) { using( var reader = new BinaryReader( stream ) ) { // Consume the DDR first var ddr = DataDescriptiveRecord.FromStream( reader ); _leader = DataRecordLeader.FromStream( reader ); } stream.Close(); } }