Skip to content

s2: Read skippable block at the beginning of the stream #915

Answered by klauspost
Jille asked this question in Q&A
Discussion options

You must be logged in to vote

In general the Reader does no do any "ahead-of-time" reading.

However, it seems like doing a 0 byte read like this (*Reader).Read([]byte{}) should trigger it to read ahead and should return your skippable block.

If that works, I wouldn't mind making this "official API" and document/test this behavior.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Jille
Comment options

@Jille
Comment options

@Jille
Comment options

@klauspost
Comment options

Answer selected by Jille
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #914 on January 25, 2024 11:32.