Liking cljdoc? Tell your friends :D

org.clojars.nighcoder.binio.core


decode-ascii-strclj

(decode-ascii-str b-seq)

Returns the contents of b-seq encoded as ascii string up to first occurence of 0 or the end of sequence.

Returns the contents of `b-seq` encoded as ascii string up to first occurence of 0 or the end of sequence.
sourceraw docstring

decode-bitsclj

(decode-bits bin-seq)

Returns the decimal value of bin-seq, where bin-seq is a list of 8 bits (0 or 1).

Example usage:

  => (decode-bits [0 0 1 0 1 1 1 0])
  46
Returns the decimal value of `bin-seq`, where `bin-seq` is a list of 8 bits (0 or 1).

  Example usage:
```
  => (decode-bits [0 0 1 0 1 1 1 0])
  46
```
sourceraw docstring

decode-float32clj

(decode-float32 [b0 b1 b2 b3])

Returns the decimal value of a seq of four bytes interpred as single precision floating number.

Returns the decimal value of a *seq of four bytes* interpred as single precision floating number.
sourceraw docstring

decode-slongclj

(decode-slong [b0 b1 b2 b3])

Returns the base 10 value of a seq of four bytes interpreted as a signed long (32 bit integer).

Example usage:

  => (decode-slong [-2 -30 118 108])
  -18712980
Returns the base 10 value of a *seq of four bytes* interpreted as a signed long (32 bit integer).

  Example usage:
```
  => (decode-slong [-2 -30 118 108])
  -18712980
```
sourceraw docstring

decode-slongrationalclj

(decode-slongrational [b0 b1 b2 b3 b4 b5 b6 b7])

Returns the rational value of a seq of eight bytes interpreted as two signed longs (32 bit integers). First four bytes form the numerator and the last four bytes form the denominator.

Example usage:

  => (decode-slongrational [34 41 -113 80 -33 -21 9 33])
  -573149008/538244831
Returns the rational value of a *seq of eight bytes* interpreted as two signed longs (32 bit integers).
  First four bytes form the numerator and the last four bytes form the denominator.

  Example usage:
```
  => (decode-slongrational [34 41 -113 80 -33 -21 9 33])
  -573149008/538244831
```
sourceraw docstring

decode-sshortclj

(decode-sshort [b0 b1])

Returns the base 10 value of a seq of two bytes interpreted as a signed short (16 bit integer).

Example usage:

  => (decode-sshort [12 -30])
  3298
Returns the base 10 value of a *seq of two bytes* interpreted as a signed short (16 bit integer).

  Example usage:
```
  => (decode-sshort [12 -30])
  3298
```
sourceraw docstring

decode-ubyteclj

(decode-ubyte b)

Returns the base 10 value of b interpreted as an unsigned byte (8 bit integer), where b is a byte or and integer from -128 to 127.

Returns the base 10 value of `b` interpreted as an unsigned byte (8 bit integer), where `b` is a **byte** or and integer from -128 to 127. 
sourceraw docstring

decode-ulongclj

(decode-ulong [b0 b1 b2 b3])

Returns the base 10 value of a seq of four bytes interpreted as an unsigned long (32 bit integer).

Example usage:

  => (decode-ulong [-2 -30 118 108])
  4276254316
Returns the base 10 value of a *seq of four bytes* interpreted as an unsigned long (32 bit integer).

  Example usage:
```
  => (decode-ulong [-2 -30 118 108])
  4276254316
```
sourceraw docstring

decode-ulongrationalclj

(decode-ulongrational [b0 b1 b2 b3 b4 b5 b6 b7])

Returns the rational value of a seq of eight bytes interpreted as two unsigned longs (32 bit integers). First four bytes form the numerator and the last four bytes form the denominator.

Example usage:

  => (decode-ulongrational [34 41 -113 80 -33 -21 9 33])
  573149008/3756722465
Returns the rational value of a *seq of eight bytes* interpreted as two unsigned longs (32 bit integers).
  First four bytes form the numerator and the last four bytes form the denominator.

  Example usage:
```
  => (decode-ulongrational [34 41 -113 80 -33 -21 9 33])
  573149008/3756722465
```
sourceraw docstring

decode-ushortclj

(decode-ushort [b0 b1])

Returns the base 10 value of a seq of two bytes interpreted as an unsigned short (16 bit integer).

Example usage:

  => (decode-ushort [12 -30])
  3298
Returns the base 10 value of a *seq of two bytes* interpreted as an unsigned short (16 bit integer).

  Example usage:
```
  => (decode-ushort [12 -30])
  3298
```
sourceraw docstring

encode-bitsclj

(encode-bits n)

Returns a list of 8 bits (0 or 1) that represents the number n in base 2. n is a unsigned byte or an integer from 0 to 255 inclusive.

Example usage:

  => (encode-bits 22)
  (0 0 0 1 0 1 1 0)
Returns a list of 8 bits (0 or 1) that represents the number `n` in base 2.
  `n` is a unsigned byte or an integer from 0 to 255 inclusive.

  Example usage:
```
  => (encode-bits 22)
  (0 0 0 1 0 1 1 0)
```
sourceraw docstring

hexclj

(hex n)
source

slurp-bytesclj

(slurp-bytes uri)

Attempts to open uri as input stream and copy its content to a byte array.

Attempts to open uri as input stream and copy its content to a byte array.
sourceraw docstring

spit-bytesclj

(spit-bytes filename content & opt)

Saves content to filename. Passes opt to output stream.

Saves `content` to `filename`. Passes `opt` to output stream.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close