blob: 12c761a2e7f977090164dac5315aab1e564d99f5 [file] [log] [blame]
Scott Baker2d897982019-09-24 11:50:08 -07001//+build !go1.10
2
3package lz4
4
5import (
6 "bytes"
7 "fmt"
8)
9
10func (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}