Class AoCharArrayWriter

    • Constructor Detail

      • AoCharArrayWriter

        public AoCharArrayWriter()
      • AoCharArrayWriter

        public AoCharArrayWriter​(int initialSize)
    • Method Detail

      • getInternalCharArray

        public char[] getInternalCharArray()
      • getLength

        public long getLength()
        Description copied from interface: Writable
        Gets the number of characters represented by this Writable.
        Specified by:
        getLength in interface Writable
      • isFastToString

        public boolean isFastToString()
        Description copied from interface: Writable
        Checks if the writable will be able to be converted toString in an extremely efficient manner. This means without allocating any new buffer space or string copies. Callers should prefer toString over writeTo or appendTo when isFastToString returns true.

        Note: As of Java 1.7.0_06, String.substring(int, int) and related operations now copy underlying buffers.

        Specified by:
        isFastToString in interface Writable
      • toString

        public String toString​(int off,
                               int len)
        Converts a portion of the input data to a string.
        Returns:
        the string.
      • writeTo

        public void writeTo​(Writer out,
                            long off,
                            long len)
                     throws IOException
        Writes a portion of the contents of the buffer to another character stream.
        Specified by:
        writeTo in interface Writable
        Throws:
        IOException
      • writeTo

        public void writeTo​(Encoder encoder,
                            Writer out)
                     throws IOException
        Description copied from interface: Writable
        Writes a streamed version of the object's String representation using the given encoder. What is written must be the same as if encoder.write(this.toString(), out) were called, but may be a much more efficient implementation.
        Specified by:
        writeTo in interface Writable
        Parameters:
        encoder - if null, no encoding is performed and will be the same as a call to Writable.writeTo(java.io.Writer)
        Throws:
        IOException
      • writeTo

        public void writeTo​(Encoder encoder,
                            Writer out,
                            long off,
                            long len)
                     throws IOException
        Description copied from interface: Writable
        Writes a streamed version of the object's String representation using the given encoder. What is written must be the same as if encoder.write(this.toString(), off, len, out) were called, but may be a much more efficient implementation.
        Specified by:
        writeTo in interface Writable
        Parameters:
        encoder - if null, no encoding is performed and will be the same as a call to Writable.writeTo(java.io.Writer, long, long)
        Throws:
        IOException