You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new codec is implemented by extending the process function, which gives you a number of input bytes to transcode, and a number of bytes to write the result to. Right now, there is, as far as I can see, no way of requesting at least N bytes of input/output space. This makes it a little annoying to implement blocked codexes.
Here, even though the stream has 2^18 bytes of buffer, and the file is 1.5*2^17, only 2^17 bytes is read into the buffer at a time.
What assumptions can we make about the number of available bytes? Could we, somehow, force the codec to make at least N bytes available, unless we read the EOF?
The text was updated successfully, but these errors were encountered:
For future reference, the internal function makemargin!(::Buffer, N) will resize the buffer so that at least N bytes from the margin (that is, the end of the usable data) to the end of the buffer. It will not resize if there is already that much space, and will move away unmarked and used up data to make room before resizing.
This is purely internal, so not really safe for use. Still, useful to know.
If I set eager=true in fillbuffer, bytesavailable says I've processed the full 1.5*2^17 bytes. Without eager set, eof(stream.stream); bytesavailable(stream.stream) gave me 32768, which matched read(stream, UInt8); bytesavailable(stream). So I think this is limited by the input stream.
A new codec is implemented by extending the
process
function, which gives you a number of input bytes to transcode, and a number of bytes to write the result to. Right now, there is, as far as I can see, no way of requesting at least N bytes of input/output space. This makes it a little annoying to implement blocked codexes.E.g. in the following example:
Here, even though the stream has 2^18 bytes of buffer, and the file is 1.5*2^17, only 2^17 bytes is read into the buffer at a time.
What assumptions can we make about the number of available bytes? Could we, somehow, force the codec to make at least N bytes available, unless we read the EOF?
The text was updated successfully, but these errors were encountered: