public BufferReader(byte[] buffer) { if (buffer == null) { throw new Exception("buffer can't be null"); } this.buffer = buffer; this.length = (uint)buffer.Length; this.position = 0; }