| 71 | } |
| 72 | |
| 73 | virtual int read (void* ptr, size_t len) { |
| 74 | while (buf_.Length() < len) { |
| 75 | bool hasNext = DecodeNextFrame (this); |
| 76 | if (HasFatalFailure()) { |
| 77 | return -1; |
| 78 | } |
| 79 | if (!hasNext) { |
| 80 | if (buf_.Length() == 0) { |
| 81 | return -1; |
| 82 | } |
| 83 | break; |
| 84 | } |
| 85 | } |
| 86 | return (int) buf_.PopFront (static_cast<uint8_t*> (ptr), len); |
| 87 | } |
| 88 | |
| 89 | protected: |
| 90 | SHA1Context ctx_; |
no test coverage detected