Class BytesInStream#

Inheritance Relationships#

Base Type#

Class Documentation#

class BytesInStream : public tvm::support::Stream#

Read-only stream over a fixed memory region.

Public Functions

inline BytesInStream(const void *data, size_t size)#
inline explicit BytesInStream(const ffi::Bytes &bytes)#
inline explicit BytesInStream(const std::string &str)#
inline virtual size_t Read(void *ptr, size_t size) override#

Read raw bytes from the stream.

Parameters:
  • ptr – Destination buffer.

  • size – Number of bytes to read.

Returns:

Number of bytes actually read.

inline virtual size_t Write(const void*, size_t) override#

Write raw bytes to the stream.

Parameters:
  • ptr – Source buffer.

  • size – Number of bytes to write.

Returns:

Number of bytes actually written.