1 #ifndef __PBIO_API__PBIO__STL_WRAPS_IMPLS__WRAP_ISTREAM_BUFFER_IMPL_H_
2 #define __PBIO_API__PBIO__STL_WRAPS_IMPLS__WRAP_ISTREAM_BUFFER_IMPL_H_
10 #include "pbio/stl_wraps/WrapIStream.h"
17 class WrapIStreamBufferImpl :
public WrapIStream
20 WrapIStreamBufferImpl(
21 const char*
const data,
30 virtual void read(
char* buf, uint64_t size)
32 const uint64_t copy_size = std::min<uint64_t>(size, _size - _pos);
36 memcpy(buf, _data + _pos, copy_size);
42 memset(buf + copy_size, 0, size - copy_size);
48 const char*
const _data;
59 #endif // __PBIO_API__PBIO__STL_WRAPS_IMPLS__WRAP_ISTREAM_BUFFER_IMPL_H_