Virgil Security Crypto library  1.8.2
VirgilBytesDataSource.h
1 
37 #ifndef VIRGIL_CRYPTO_VIRGIL_BYTES_DATA_SOURCE_H
38 #define VIRGIL_CRYPTO_VIRGIL_BYTES_DATA_SOURCE_H
39 
40 #include <virgil/crypto/VirgilByteArray.h>
41 #include <virgil/crypto/VirgilDataSource.h>
42 
43 namespace virgil { namespace crypto { namespace stream {
44 
51 public:
58  explicit VirgilBytesDataSource(const virgil::crypto::VirgilByteArray& in, size_t chunkSize = 5);
59 
63  virtual ~VirgilBytesDataSource() throw();
64 
68  virtual bool hasData();
69 
73  virtual virgil::crypto::VirgilByteArray read();
74 
80  virtual void reset();
81 
82 private:
83  const virgil::crypto::VirgilByteArray& in_;
84  const size_t chunkSize_;
85  size_t leftBytes_;
86 };
87 
88 }}}
89 
90 #endif /* VIRGIL_CRYPTO_VIRGIL_BYTES_DATA_SOURCE_H */
virtual virgil::crypto::VirgilByteArray read()
Overriding of VirgilDataSource::read() method.
C++ Byte Array implementation of the VirgilDataSource class.
Definition: VirgilBytesDataSource.h:50
VirgilBytesDataSource(const virgil::crypto::VirgilByteArray &in, size_t chunkSize=5)
Creates data sink based on byte array.
virtual bool hasData()
Overriding of VirgilDataSource::hasData() method.
virtual void reset()
Reset internal state to initial.
Definition: VirgilAsn1Compatible.h:46
virtual ~VirgilBytesDataSource()
Polymorphic destructor.
This is base class for input streams.
Definition: VirgilDataSource.h:49