BinaryReader.BaseStream : BinaryReader « System.IO « C# / C Sharp by API






BinaryReader.BaseStream

 
using System;
using System.IO;


class Class1 {
    static void Main(string[] args) {
        string[] cma = Environment.GetCommandLineArgs();

        if (cma.GetUpperBound(0) >= 1) {
            FileStream myFStream = new FileStream(cma[1], FileMode.Open, FileAccess.Read);
            BinaryReader binRead = new BinaryReader(myFStream);
            binRead.BaseStream.Position = 0x12;
            
            Console.WriteLine(binRead.ReadInt32());
            Console.WriteLine(binRead.ReadInt32());
            Console.WriteLine(binRead.ReadInt16());
            Console.WriteLine(binRead.ReadInt16());

            binRead.Close();
            myFStream.Close();
        }
    }
}

   
  








Related examples in the same category

1.new BinaryReader(FileStream fs)
2.BinaryReader.PeekChar()
3.BinaryReader.ReadByte()
4.BinaryReader.ReadChar()
5.BinaryReader.ReadDecimal()
6.BinaryReader.ReadDouble()
7.BinaryReader.ReadInt32()
8.BinaryReader.ReadString()