Class RunLengthEncoding

java.lang.Object
org.rcsb.cif.binary.encoding.RunLengthEncoding
All Implemented Interfaces:
Encoding<IntArray,​Int32Array>

public class RunLengthEncoding
extends Object
implements Encoding<IntArray,​Int32Array>

Represents each integer value in the input as a pair of (value, number of repeats) and stores the result sequentially as Int32Array. Additionally, stores the size of the original array to make decoding easier.

 RunLength {
     kind = "RunLength"
     srcType: int[]
     srcSize: number
 }
 Example
 [1, 1, 1, 2, 3, 3]
 ---RunLength--->
 { srcSize = 6 } [1, 3, 2, 1, 3, 2]