-
Effekt Library
- bytestream
- BE
- LE
- OfWidth
- Signed
- Bit
- B0
- B1
- not
- HexSplices
- bytesLE
- bytesLE
- bytesBE
- bytesBE
- signedBytesLE
- signedBytesBE
- signedBytesLE
- signedBytesBE
- hex
- x
- bitsLE
- bitsBE
- bitsLE
- bitsBE
- bitsBE
- collectBitsBE
- ungroupBytesBE
- twoscomplementLE
- groupBytesBE
- groupBytesLE
- BitSplices
- bit
- bytestream Jump to source: libraries/common/bytestream.effekt
- BE
[A] (raw: A) - LE
[A] (raw: A) - OfWidth
[A] (raw: A, width: Int) - Signed
[A] (raw: A) - Bit
- B0
- B1
- not
(b: Bit): Bit / {} - HexSplices
- bytesLE
(int: Int, w: Int): Unit / {emit[Byte]} - bytesLE
(int: Int): Unit / {emit[Byte]} - bytesBE
(n: Int, width: Int): Unit / {emit[Byte]} - bytesBE
(n: Int): Unit / {emit[Byte]} - signedBytesLE
(int: Int, width: Int): Unit / {emit[Byte]} - signedBytesBE
(int: Int, width: Int): Unit / {emit[Byte]} - signedBytesLE
(int: Int): Unit / {emit[Byte]} - signedBytesBE
(int: Int): Unit / {emit[Byte]} - hex
{ body: => Unit / {write, HexSplices} }: Unit / {emit[Byte]} - x
{ body: => Unit / {write, HexSplices} }: Int / {} - bitsLE
(byte: Byte): Unit / {emit[Bit]} - bitsBE
(byte: Byte): Unit / {emit[Bit]} - bitsLE
(v: Int, width: Int): Unit / {emit[Bit]} - bitsBE
(v: Int, width: Int): Unit / {emit[Bit]} - bitsBE
(int: Int): Unit / {emit[Bit]} - collectBitsBE
{ body: => Unit / {emit[Bit]} }: Int / {} - ungroupBytesBE
{ body: => Unit / {emit[Byte]} }: Unit / {emit[Bit]} - twoscomplementLE
{ body: => Unit / {emit[Bit]} }: Unit / {emit[Bit]} - groupBytesBE
{ body: => Unit / {emit[Bit]} }: Unit / {emit[Byte]} - groupBytesLE
{ body: => Unit / {emit[Bit]} }: Unit / {emit[Byte]} - BitSplices
- bit
{ body: => Unit / {write, BitSplices} }: Unit / {emit[Bit]}
Example usage: examples/stdlib/bytestream
A with explicit big-endian order
A with explicit little-endian order
A with explicit width in current unit (bits for bitstreams, bytes for bytestreams)
explicitly signed A
Bits
not on Bits
Splices allowed in hex/byte stream literals
emit bytes of the given int as a w bytes in little-endian byte order
emit bytes of the given int as a 4 bytes in little-endian byte order
emit bytes of the given int as a w bytes in big-endian byte order
emit bytes of the given int as a 4 bytes in big-endian byte order
emit bytes of the given int as width bytes (in 2s-complement) in little-endian byte order
emit bytes of the given int as width bytes (in 2s-complement) in big-endian byte order
emit bytes of the given int as 4 bytes (in 2s-complement) in little-endian byte order
emit bytes of the given int as 4 bytes (in 2s-complement) in big-endian byte order
Splicer to emit the bytes in hex notation given, plus eventual splices Ignores whitespace
convert the given hex notation to an integer (big-endian)
emit bits of the given Byte as 8 Bits in little-endian bit order
emit bits of the given Byte as 8 Bits in big-endian bit order
emit bits of the given Byte as width Bits in little-endian bit order
emit bits of the given int as width Bits in big-endian bit order
emit bits of the given int as 32 Bits in big-endian bit order
collect bits in big-endian bit order into an Int
split emitted bytes and emit the individual bits in big-endian bit order
streaming negation in 2s-complement for little-endian bitstreams
group 8 bits into a byte each, big-endian bit order. NOTE: The remainder is dropped.
group 8 bits into a byte each, little-endian bit order. NOTE: The remainder is dropped.
Splices allowed in bit stream literals
Splicer to emit the bits in binary notation given, plus evenutal splices Ignores whitespace