How to set file pointer using BinaryWriter

  • Thread starter Thread starter Lisa
  • Start date Start date
L

Lisa

Using C# .NET, I want to create a BinaryWriter to read Int32 data from a
file, but I don't see any facility to set the file pointer to a specific
point within the file.

Thanks for any help.

Lisa
 
Lisa said:
Using C# .NET, I want to create a BinaryWriter to read Int32 data from a
file, but I don't see any facility to set the file pointer to a specific
point within the file.

Create a BinaryReader for the appropriate stream, and then use
Stream.Seek() or the Stream.Position property to seek within the file.

(Note that you want BinaryReader rather than BinaryWriter if you really
want to read from the file.)
 
Back
Top