#What is SeekableStream?

1 messages · Page 1 of 1 (latest)

novel estuary
#

and what is readStruct?

#

and also fixedBufferStream ? what is the difference between seekablestream and fixedbufferstream

undone linden
#

FixedBufferStream is like a port for ways to interface with a block of memory

#

it allows you to read and write from it in a way that can also be seeked so you can jump to whatever position

#

it's not an interface, it's a full implementation of reading and writing a block of memory

#

SeekableStream is an interface for something that can be seeked

#

so for a function that takes in SOMETHING that can be seeked but doesn't care what the source is, you can pass fixedBuffer.seekableStream() into it

#

I'm not sure what readStruct is

#

oh, read struct just casts a block of bytes into the layout of a struct

#

it has to be either a packed or extern struct, so that the layout is well defined