code: public char[] readAsCharArray()
      {
          int currentSize = size();
          if (currentSize == 0)
          {
              return new char[0];
          }
  
          FixedCharArrayWriter target = new FixedCharArrayWriter(currentSize);
          try
          {
              writeTo(target);
          }
          catch (IOException e)
          {
              throw new RuntimeException("Unexpected IOException", e);
          }
          return target.getCharArray();
      }
docs: Reads the buffer to a char[].
  
  @return the chars