Matteo Scandolo | 9a2772a | 2018-11-19 14:56:26 -0800 | [diff] [blame] | 1 | //+build !go1.10 |
| 2 | |
| 3 | package lz4 |
| 4 | |
| 5 | import ( |
| 6 | "bytes" |
| 7 | "fmt" |
| 8 | ) |
| 9 | |
| 10 | func (h Header) String() string { |
| 11 | var s bytes.Buffer |
| 12 | |
| 13 | s.WriteString(fmt.Sprintf("%T{", h)) |
| 14 | if h.BlockChecksum { |
| 15 | s.WriteString("BlockChecksum: true ") |
| 16 | } |
| 17 | if h.NoChecksum { |
| 18 | s.WriteString("NoChecksum: true ") |
| 19 | } |
| 20 | if bs := h.BlockMaxSize; bs != 0 && bs != 4<<20 { |
| 21 | s.WriteString(fmt.Sprintf("BlockMaxSize: %d ", bs)) |
| 22 | } |
| 23 | if l := h.CompressionLevel; l != 0 { |
| 24 | s.WriteString(fmt.Sprintf("CompressionLevel: %d ", l)) |
| 25 | } |
| 26 | s.WriteByte('}') |
| 27 | |
| 28 | return s.String() |
| 29 | } |