/// <summary> /// Reads bytes buffer from the stream. /// </summary> /// <param name="bytes">Buffer pointer where bytes should be stored.</param> /// <param name="count">Number of bytes to from the stream</param> public unsafe void ReadBytes(byte *bytes, uint count) { if (count < blockRemaining) { BaseReader.ReadBytes(bytes, count); position += count; blockRemaining -= count; } else { while (count > 0) { uint read = count < blockRemaining ? count : blockRemaining; BaseReader.ReadBytes(bytes, read); position += read; blockRemaining -= read; CheckMoveReader(); count -= read; bytes += read; } } }
public byte[] ReadBytes(int count) => BaseReader.ReadBytes(count);