Class StringEncoder


  • public class StringEncoder
    extends java.lang.Object
    Optimized String Encoder. Encoding many small strings in a simple Encoder is not very efficient. The function call to decode a string takes some time and creates references that must be eventually deleted. In practice, when decoding several million small strings, the GC will kick in more and more often to collect orphaned string objects (or maybe there is another reason?). This string encoder solves the above problem. All strings are concatenated and written as a single string using a single encoding call. The lengths are encoded using a UintOptRleEncoder.
    • Constructor Summary

      Constructors 
      Constructor Description
      StringEncoder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Uint8Array toUint8Array()  
      void write​(java.lang.String str)  
      • Methods inherited from class java.lang.Object

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

      • StringEncoder

        public StringEncoder()
    • Method Detail

      • write

        public void write​(java.lang.String str)