Size returns the number of bytes of data currently stored within a Stream object.
()
| 115 | |
| 116 | // Size returns the number of bytes of data currently stored within a Stream object. |
| 117 | func (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. |
| 129 | func (s *Stream) Next() (*LockedBuffer, error) { |