public int NextInt32() { var result = BitConverter.ToInt32(Data.Span.Slice(SeekOffset, 4).ToArray(), 0); SeekOffset += 4; return(ByteOrderConverter.To(Endianness, result)); }
public ulong NextUint64() { var result = BitConverter.ToUInt64(Data.Span.Slice(SeekOffset, 8).ToArray(), 0); SeekOffset += 8; return(ByteOrderConverter.To(Endianness, result)); }
public ushort NextUint16() { var result = BitConverter.ToUInt16(Data.Span.Slice(SeekOffset, 2).ToArray(), 0); SeekOffset += 2; return(ByteOrderConverter.To(Endianness, result)); }
public void AddInt32(int value) { EnsureCapacity(4); value = ByteOrderConverter.To(Endianness, value); foreach (var b in BitConverter.GetBytes(value)) { Data[SeekOffset++] = b; } }