On this page:
8.18
top
up

1BytesπŸ”— i

procedure

( read-bytes* len[in])bytes?

Like read-bytes , but returns a byte string of exactly len bytes. If fewer than len bytes are available before the end of input, an exception is raised.

Examples:
> (define in(open-input-bytes #"abcde"))
> (read-bytes* 4in)

#"abcd"

> (read-bytes* 2in)

read-bytes*: unexpected end of input

tried to read: 2 bytes

available: 1 bytes

received: #"e"

procedure

[ out
start
end])void?
bstr:bytes?
Writes bytes to out from bstr from index start (inclusive) to end (exclusive), and then writes a null (0) byte terminator.

If bstr contains any null bytes between start and end, an error is raised.

procedure

( read-null-terminated-bytes [in])bytes?

Reads from in until a null (0) byte is found, then returns the bytes read, excluding the null terminator. If no null terminator is found before the end of input, an error is raised.

Examples:
> (define-values (inout)(make-pipe ))

#"abcde"

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /