class ASN1::BER::Length

Defined in:

bindata/asn1/length.cr

Constant Summary

BIT_PARTS = [{long => {UInt8, nil}, length_indicator => {UInt8, nil}}] of Nil
ENDIAN = ["big"]
INDEX = [0]
PARTS = [{"bitfield", 0, nil, nil, nil, nil}, {"array", long_bytes, UInt8, nil, -> do if long && (!indefinite?) if length_indicator > 4 raise("invalid ASN.1 BER length. Number of length bytes: #{length_indicator}") end 0 | length_indicator else 0 end end, nil, nil}] of Nil

Instance Method Summary

Instance methods inherited from class BinData

__format__ : IO::ByteFormat __format__, read(io : IO) : IO read, to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian) to_io, to_slice to_slice, write(io : IO) : IO write

Class methods inherited from class BinData

from_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian) from_io

Instance Method Detail

def __format__ : IO::ByteFormat #

[View source]
def indefinite? #

[View source]
def length : Int32 #

We can pretty much safely assume no protocol is implementing more than positive Int32 length datagrams


[View source]
def length=(length : Int32) #

We can pretty much safely assume no protocol is implementing more than positive Int32 length datagrams


[View source]
def length_indicator : UInt8 #

def length_indicator=(length_indicator : UInt8) #

def long : Bool #

[View source]
def long=(long : UInt8) #

def long=(value : Bool) #

[View source]
def long_bytes : Array(UInt8) #

def long_bytes=(long_bytes : Array(UInt8)) #

def read(io : IO) : IO #

[View source]
def write(io : IO) : IO #

[View source]