BasicEncodingRulesElement.this

Creates a BERElement from the supplied bytes, inferring that the first byte is the type tag. The supplied ubyte[] array is "chomped" by reference, so the original array will grow shorter as BERElements are generated.

  1. this()
  2. this(ubyte[] bytes)
    class BasicEncodingRulesElement
    @system
    this
    (
    ref ubyte[] bytes
    )
  3. this(size_t bytesRead, ubyte[] bytes)

Throws

All of the same exceptions as fromBytes()

Examples

// Decoding looks like:
BERElement[] result;
while (bytes.length > 0)
    result ~= new BERElement(bytes);

// Encoding looks like:
ubyte[] result;
foreach (bv; bervalues)
{
    result ~= cast(ubyte[]) bv;
}

Meta