I have a memorystream reading a specific part of my data. From the binary I want one ReadInt32 value from position 5-8. How do I achieve this in:
using (var reader = new BinaryReader(stream))
{
somebyte1
somebyte2
somebyte3
//get only this value
int v = reader.ReadInt32;
}
Move the base stream to the position you want to read from:
stream.Seek(4, SeekOrigin.Begin);
using (var reader = new BinaryReader(stream))
{
int v = reader.ReadInt32;
}