private void WriteByteCore(byte value) { PrepareForWriting(); // Flush the write buffer if it's full if (_writePos == _bufferLength) FlushWriteBuffer(); // We now have space in the buffer. Store the byte. GetBuffer()[_writePos++] = value; }