Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.mkd

go-stream

Introduction

stream is a Go library which provides a buffered reader with convenient functions.

Usage

The following example parses what looks like a HTTP header. Error return values are ignored.

s := stream.NewStreamBytes([]byte("Content-Length: 42\r\n"))
s.ReadUntilByteAndSkip(':') // yields []byte("Content-Length")
s.SkipWhile(func(b byte) bool {
	return b == ' ' || b == '\t'
})
s.ReadUntilAndSkip([]byte{'\r', '\n'}) // yields []byte("42")

Contact

If you have an idea or a question, email me at khaelin@gmail.com.

About

A convenient buffered reader.

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.