diff options
Diffstat (limited to 'src/stream.cpp')
-rw-r--r-- | src/stream.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/stream.cpp b/src/stream.cpp index f3dd322..ec1d5da 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -51,7 +51,7 @@ void datastream_put_i16(datastream_t *self, int16_t val) { *self << val; } void datastream_put_i32(datastream_t *self, int32_t val) { *self << val; } void datastream_put_data(datastream_t *self, - uint8_t *begin, uint8_t *end) { + const uint8_t *begin, const uint8_t *end) { self->put_data(begin, end); } @@ -87,6 +87,14 @@ uint256_t *datastream_get_hash(const datastream_t *self) { return new uint256_t(self->get_hash()); } +void datastream_free(const datastream_t *self) { delete self; } + +bytearray_t *datastream_to_bytearray(datastream_t *self) { + auto res = new bytearray_t(std::move(*self)); + delete self; + return res; +} + } #endif |