# sys::BufInStream

    sys::Obj
      sys::Virtual
        sys::InStream
          sys::BufInStream

`public final class BufInStream`

BufInStream is used to read bytes from a memory Buf.

buf

  `public Buf buf`

pos

  `public short pos`

BufInStream

  `public void BufInStream(Buf buf)`

  Construct for specified Buf instance.

read

  `public override int read()`

  Read the next byte at pos and increment pos. Return -1 if pos >= size.

readBytes

  `public override int readBytes(byte[] b, int off, int len)`

  Read the next block of available bytes starting from pos. Return the number of bytes copied into b and advance the position likewise.

readStrInPlace

  `public Str readStrInPlace(Str str)`

  Read the current position as a null terminated string. Return null on error.

rewind

  `public void rewind()`

  Rewind sets the pos back to zero to begin reading the Buf from the beginning.