Pragya Arya | 324337e | 2020-02-20 14:35:08 +0530 | [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 | } |