Skip to content

Commit

Permalink
Merge pull request #92 from moredure/patch-1
Browse files Browse the repository at this point in the history
add compatibility with flate.Reader
  • Loading branch information
worg authored Mar 13, 2021
2 parents 0036ca2 + 2796331 commit 1509067
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,12 @@ func (msg *Message) Read(p []byte) (int, error) {
msg.Body = msg.Body[n:]
return n, nil
}

func (msg *Message) ReadByte() (byte, error) {
if len(msg.Body) == 0 {
return 0, io.EOF
}
n := msg.Body[0]
msg.Body = msg.Body[1:]
return n, nil
}

0 comments on commit 1509067

Please sign in to comment.