Flush flushes the suffix to the underlying writer.
()
| 24 | |
| 25 | // Flush flushes the suffix to the underlying writer. |
| 26 | func (p *PrefixSuffixWriter) Flush() error { |
| 27 | _, err := io.Copy(p.W, bytes.NewReader(p.suffix[p.suffixOff:])) |
| 28 | if err != nil { |
| 29 | return err |
| 30 | } |
| 31 | |
| 32 | _, err = io.Copy(p.W, bytes.NewReader(p.suffix[:p.suffixOff])) |
| 33 | return err |
| 34 | } |
| 35 | |
| 36 | func (p *PrefixSuffixWriter) Write(b []byte) (int, error) { |
| 37 | lenb := len(b) |
no outgoing calls