Scott Baker | eee8dd8 | 2019-09-24 12:52:34 -0700 | [diff] [blame] | 1 | //+build go1.10 |
| 2 | |
| 3 | package lz4 |
| 4 | |
| 5 | import ( |
| 6 | "fmt" |
| 7 | "strings" |
| 8 | ) |
| 9 | |
| 10 | func (h Header) String() string { |
| 11 | var s strings.Builder |
| 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 | } |