blob: 9a0fb00709d569ae3475c264feef1fd9109eaf26 [file] [log] [blame]
Pragya Arya324337e2020-02-20 14:35:08 +05301//+build go1.10
2
3package lz4
4
5import (
6 "fmt"
7 "strings"
8)
9
10func (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}