Class ValueEncoderFactory.StringEncoder

  • Enclosing class:
    ValueEncoderFactory

    static final class ValueEncoderFactory.StringEncoder
    extends ValueEncoderFactory.ScalarEncoder
    Implementation of textual encoder that operates on longer textual values. Because of length, it is possible that output has to be done in multiple pieces. As a result, there is need to track current position withing text.

    In addition, instances of this class are not recycled, as it seems less beneficial (less likely to need to be reused, or offer performance improvements if they would be)

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected StringEncoder​(java.lang.String value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int encodeMore​(byte[] buffer, int ptr, int end)  
      int encodeMore​(char[] buffer, int ptr, int end)  
      boolean isCompleted()
      Method that can alternatively be called to determine whether encoder has encoded all data it has.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _value

        java.lang.String _value
      • _offset

        int _offset
    • Constructor Detail

      • StringEncoder

        protected StringEncoder​(java.lang.String value)
    • Method Detail

      • encodeMore

        public int encodeMore​(char[] buffer,
                              int ptr,
                              int end)
        Specified by:
        encodeMore in class AsciiValueEncoder
        Returns:
        Value of pointer after all remaining data (which may be "none") that can be encoded (as constrained by buffer length) has been encoded. Has to exceed 'ptr' value sent in; will be equal to it if nothing was encoded (which should only occur when everything has been encoded, as long as AsciiValueEncoder.bufferNeedsFlush(int) is appropriately called once before calling this method)
      • encodeMore

        public int encodeMore​(byte[] buffer,
                              int ptr,
                              int end)
        Specified by:
        encodeMore in class AsciiValueEncoder
        Returns:
        Value of pointer after all remaining data (which may be "none") that can be encoded (as constrained by buffer length) has been encoded. Has to exceed 'ptr' value sent in; will be equal to it if nothing was encoded (which should only occur when everything has been encoded, as long as AsciiValueEncoder.bufferNeedsFlush(int) is appropriately called once before calling this method)