bytevector>u8list, bytevector>sintlist, bytevector>uintlist  convert a bytevector to a list of integers
LIBRARY
(import (rnrs)) ;R6RS
(import (rnrs bytevectors)) ;R6RS
SYNOPSIS
(bytevector>u8list bytevector)
(bytevector>sintlist bytevector endianness size)
(bytevector>uintlist bytevector endianness size)
DESCRIPTION
These procedures convert a bytevector to a list of integer objects
according to
size
and
endianness.
The integers have the same order as the data in
bytevector.
The
bytevector>u8list
procedure is the same as
bytevector>uintlist
with a size of 1. It returns a newly allocated list of the octets
of
bytevector
in the same order.
RETURN VALUES
Returns a newly allocated list of exact integer objects.
EXAMPLES
(let ((b (makebytevector 4 127)))
(bytevector>u8list b))
=> #vu8(129 129 129 129)
(let ([b (u8list>bytevector
'(#x1 #x2 #x3 #xFF #x1 #x2 #x1 #x2))])
(bytevector>sintlist b (endianness little) #x2))
=> (#x201 #xFD #x201 #x201)
(let ([b (u8list>bytevector
'(#x1 #x2 #x3 #xFF #x1 #x2 #x1 #x2))])
(bytevector>uintlist b (endianness little) #x2))
=> (#x201 #xFF03 #x201 #x201)
ERRORS
This procedure can raise exceptions with the following condition types:
 &assertion (R6RS)

The wrong number of arguments was passed or an argument was outside its domain.
In particular,
size
must be a positive exact integer object and
bytevector
must be evenly divisible by
size.
SEE ALSO
endianness(7scm),
u8list>bytevector(3scm)
STANDARDS
R6RS
AUTHORS
This page is part of the
schememanpages
project.
It includes materials from the RnRS documents.
More information can be found at
https://github.com/schemedoc/manpages/
.
Markup created by unroff 1.0sc, March 04, 2023.