public class LengthEncoder
extends java.lang.Object
Constructor and Description |
---|
LengthEncoder() |
Modifier and Type | Method and Description |
---|---|
byte[] |
encode(byte[] value)
Returns the length of the given value as a byte array of variable length.
|
byte[] |
encode(long length)
Encodes the given length value to bytes following the DER encoding rules for the length.
|
public byte[] encode(byte[] value)
value
- valuepublic byte[] encode(long length) throws java.io.IOException
length
- length to encodejava.io.IOException
- if length less than 0