Dotty Documentation

0.14.0-bin-SNAPSHOT

object ByteCodecs
extends Object with Serializable

[-] Constructors

[-] Members

[+] def avoidZero ( src: Array [ Byte ] ) : Array [ Byte ]
[+] def decode ( xs: Array [ Byte ] ) : Int

Destructively decodes array xs and returns the length of the decoded array.

Sometimes returns (length + 1) of the decoded array. Example:

scala> val enc = reflect.generic.ByteCodecs.encode(Array(1,2,3)) enc: Array[Byte] = Array(2, 5, 13, 1)

scala> reflect.generic.ByteCodecs.decode(enc) res43: Int = 4

scala> enc res44: Array[Byte] = Array(1, 2, 3, 0)

However, this does not always happen.

[+] def decode7to8 ( src: Array [ Byte ] , srclen: Int ) : Int
[+] def encode ( xs: Array [ Byte ] ) : Array [ Byte ]
[+] def encode8to7 ( src: Array [ Byte ] ) : Array [ Byte ]
[+] def regenerateZero ( src: Array [ Byte ] ) : Int