|
@ -87,7 +87,6 @@ func (n *Needle) Append(w io.Writer, version Version) (size uint32, err error) { |
|
|
if _, err = w.Write(header[0:1]); err != nil { |
|
|
if _, err = w.Write(header[0:1]); err != nil { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if n.HasName() { |
|
|
if n.HasName() { |
|
|
util.Uint8toBytes(header[0:1], n.NameSize) |
|
|
util.Uint8toBytes(header[0:1], n.NameSize) |
|
|
if _, err = w.Write(header[0:1]); err != nil { |
|
|
if _, err = w.Write(header[0:1]); err != nil { |
|
@ -112,6 +111,7 @@ func (n *Needle) Append(w io.Writer, version Version) (size uint32, err error) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
padding := NeedlePaddingSize - ((NeedleHeaderSize + n.Size + NeedleChecksumSize) % NeedlePaddingSize) |
|
|
padding := NeedlePaddingSize - ((NeedleHeaderSize + n.Size + NeedleChecksumSize) % NeedlePaddingSize) |
|
|
util.Uint32toBytes(header[0:NeedleChecksumSize], n.Checksum.Value()) |
|
|
util.Uint32toBytes(header[0:NeedleChecksumSize], n.Checksum.Value()) |
|
|
_, err = w.Write(header[0 : NeedleChecksumSize+padding]) |
|
|
_, err = w.Write(header[0 : NeedleChecksumSize+padding]) |
|
|