MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / WriteBody

Method WriteBody

internal/utils/bfs/file_writer.go:51–61  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

49}
50
51func (this *FileWriter) WriteBody(b []byte) (n int, err error) {
52 if !this.isPartial && !this.hasMeta {
53 err = errors.New("no meta found")
54 return
55 }
56
57 n, err = this.bFile.Write(this.hash, BlockTypeBody, b, this.originOffset)
58 this.originOffset += int64(n)
59 this.realBodySize += int64(n)
60 return
61}
62
63func (this *FileWriter) WriteBodyAt(b []byte, offset int64) (n int, err error) {
64 if !this.hasMeta {

Callers 3

TestNewFileWriterFunction · 0.80
TestFS_OpenFileWriterFunction · 0.80

Calls 1

WriteMethod · 0.65

Tested by 3

TestNewFileWriterFunction · 0.64
TestFS_OpenFileWriterFunction · 0.64