|
* Accept interfaces where appropriate.
`Fpdf.RawWriteBuf` only needs an `io.Reader`, it doesn't have to be a `bytes.Buffer`.
The only reason I can see not to do this is to avoid the interface "boxing" if the caller is actually using a `bytes.Buffer`;
however, since eventually this gets into `binary.Read` which takes an `io.Reader` the boxing will happen anyway (and possibly repeatedly if `readByte` gets called a number of times; I didn't bother to check).
* Also use interface for segmentRead
* Use read-only bytes.Reader instead of bytes.Buffer where appropriate.
|