MCPcopy
hub / github.com/awnumar/memguard / Size

Method Size

stream.go:117–126  ·  view source on GitHub ↗

Size returns the number of bytes of data currently stored within a Stream object.

()

Source from the content-addressed store, hash-verified

115
116// Size returns the number of bytes of data currently stored within a Stream object.
117func (s *Stream) Size() int {
118 s.Lock()
119 defer s.Unlock()
120
121 var n int
122 for e := s.Front(); e != nil; e = e.Next() {
123 n += e.Value.(*Enclave).Size()
124 }
125 return n
126}
127
128// Next grabs the next chunk of data from the Stream and returns it decrypted inside a LockedBuffer. Any error from the stream is forwarded.
129func (s *Stream) Next() (*LockedBuffer, error) {

Callers 15

TestStreamSizeFunction · 0.95
ReadMethod · 0.45
TestNewBufferFunction · 0.45
TestNewBufferFromBytesFunction · 0.45
TestNewBufferFromReaderFunction · 0.45
TestNewBufferRandomFunction · 0.45
TestSizeFunction · 0.45
TestReaderFunction · 0.45
TestStreamNextFlushFunction · 0.45
TestStreamingSanityFunction · 0.45

Calls 1

NextMethod · 0.80

Tested by 12

TestStreamSizeFunction · 0.76
TestNewBufferFunction · 0.36
TestNewBufferFromBytesFunction · 0.36
TestNewBufferFromReaderFunction · 0.36
TestNewBufferRandomFunction · 0.36
TestSizeFunction · 0.36
TestReaderFunction · 0.36
TestStreamNextFlushFunction · 0.36
TestStreamingSanityFunction · 0.36
TestOpenFunction · 0.36