Package io.keikai.doc.collab.lib0
Class StringEncoder
- java.lang.Object
-
- io.keikai.doc.collab.lib0.StringEncoder
-
public class StringEncoder extends java.lang.ObjectOptimized 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 Uint8ArraytoUint8Array()voidwrite(java.lang.String str)
-
-
-
Method Detail
-
write
public void write(java.lang.String str)
-
toUint8Array
public Uint8Array toUint8Array()
-
-