docs: @Override
      public void write(char[] data, int offset, int length) throws IOException {
          while (true) {
              ensureBufferAvailable();
              if (buffer.remaining() > length) {
                  buffer.backingBuffer().put(data, offset, length);
                  break;
              } else if (buffer.remaining() == length) {
                  buffer.backingBuffer().put(data, offset, length);
                  flush(false);
                  break;
              } else {
                  int chunkSize = buffer.remaining();
                  buffer.backingBuffer().put(data, offset, chunkSize);
                  flush(false);
                  length -= chunkSize;
                  offset += chunkSize;
              }
          }
      }