read stream into ring buffer, omit memcpy