move utils.Stream interface to separate file

This commit is contained in:
Marten Seemann
2017-01-05 19:37:24 +07:00
parent 4e0ef58bab
commit b741724069
2 changed files with 16 additions and 11 deletions

16
utils/stream.go Normal file
View File

@@ -0,0 +1,16 @@
package utils
import (
"io"
"github.com/lucas-clemente/quic-go/protocol"
)
// Stream is the interface for QUIC streams
type Stream interface {
io.Reader
io.Writer
io.Closer
StreamID() protocol.StreamID
CloseRemote(offset protocol.ByteCount)
}

View File

@@ -3,19 +3,8 @@ package utils
import (
"bytes"
"io"
"github.com/lucas-clemente/quic-go/protocol"
)
// Stream is the interface for QUIC streams
type Stream interface {
io.Reader
io.Writer
io.Closer
StreamID() protocol.StreamID
CloseRemote(offset protocol.ByteCount)
}
// ReadUintN reads N bytes
func ReadUintN(b io.ByteReader, length uint8) (uint64, error) {
var res uint64