MCPcopy Create free account
hub / github.com/Johonsoy/SmartStashDB / writeBuffer2File

Method writeBuffer2File

storage/segmentfile.go:189–195  ·  view source on GitHub ↗
(buffer *bytes.Buffer)

Source from the content-addressed store, hash-verified

187}
188
189func (f *SegmentFile) writeBuffer2File(buffer *bytes.Buffer) error {
190 if f.lastBlockSize > _const.BlockSize {
191 panic("lastBlockSize exceeded BlockSize")
192 }
193 _, err := f.fd.Write(buffer.Bytes())
194 return err
195}
196
197func (f *SegmentFile) appendChunk2Buffer(buffer *bytes.Buffer, data []byte, cType ChunkType) error {
198 // 设置header中的长度

Callers 2

WriteMethod · 0.95
WriteAllMethod · 0.95

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected