What is the best way in Go to skip forward a number of bytes in a stream using io.Reader
? That is, is there a function in the standard library which takes a reader and a count that will read and dispose count bytes from the reader?
Example use case:
func DoWithReader(r io.Reader) {
SkipNBytes(r, 30); // Read and dispose 30 bytes from reader
}
I don't need to go backwards in the stream so anything that can work without converting io.Reader
to another reader type would be preferred.