leb128-binary-0.1.1: Signed and unsigned LEB128 codec for binary library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Binary.SLEB128

Contents

Description

Signed LEB128 codec.

Any getXXX decoder can decode bytes generated using any of the putXXX encoders, provided the encoded number fits in the target type.

Synopsis

Put

Get

getInteger Source #

Arguments

:: Word

Maximum number of bytes to consume. If the Integer number can be determined before consuming this number of bytes, it will be. If 0, parsing fails.

Each ULEB128 byte encodes at most 7 bits of data. That is, \(length(encoded) == \lceil\frac{length(data)}{7}\rceil\).

-> Get Integer 

getNatural Source #

Arguments

:: Word

Maximum number of bytes to consume. If the Integer number can be determined before consuming this number of bytes, it will be. If 0, parsing fails.

Each ULEB128 byte encodes at most 7 bits of data. That is, \(length(encoded) == \lceil\frac{length(data)}{7}\rceil\).

-> Get Natural