InputStreamInterface Class Reference IO

#include <iostreams.h>

Inheritance diagram for InputStreamInterface:

详细描述

Interface for input streams. It allows to read data from streams. This interface needs to be implemented for each protocol.

公共成员函数

MAXON_METHOD Result < Int64 BytesAvailable () const
MAXON_FUNCTION Result < void >  读取 (const Block < Byte > &data)
MAXON_METHOD Result < Int ReadEOS (const Block < Byte > &data)
MAXON_METHOD Result < void >  Skip ( Int64 bytes)
  MAXON_DECLARATION_CLASS (Factory< InputStreamRef(const Block < const Char > &, Bool )>, FromBlock, "net.maxon.inputstreaminterface.fromblock")

私有成员函数

  MAXON_INTERFACE ( InputStreamInterface , MAXON_REFERENCE_NORMAL , "net.maxon.interface.inputstream")

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( InputStreamInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.interface.inputstream"   
)
private

◆  BytesAvailable()

MAXON_METHOD Result < Int64 > BytesAvailable ( ) const

Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream.

返回
Available number of bytes to read/skip.

◆  Read()

MAXON_FUNCTION Result <void> Read ( const Block < Byte > &  data )

Reads all bytes up to len bytes of data from the input stream into an array of bytes. 'bytes' and the result are of type Int (not Int64) as 'buffer' can never hold more bytes on a 32-bit system.

参数
[out] data Buffer which receives the read bytes.
返回
OK if all bytes could be read.

◆  ReadEOS()

MAXON_METHOD Result < Int > ReadEOS ( const Block < Byte > &  data )

Reads up to len bytes of data from the input stream into an array of bytes. 'bytes' and the result are of type Int (not Int64) as 'buffer' can never hold more bytes on a 32-bit system.

参数
[out] data Buffer which receives the read bytes.
返回
Number of bytes that has been read. If less bytes read than requested the end of the stream has been reached.

◆  Skip()

MAXON_METHOD Result <void> Skip ( Int64   bytes )

Skips over and discards n bytes of data from this input stream. If you want to Seek() forward Skip is the preferred method to call from the performance perspective.

参数
[in] bytes Number of bytes to skip from the current position.
返回
OK on success.

◆  MAXON_DECLARATION_CLASS()

MAXON_DECLARATION_CLASS ( Factory< InputStreamRef(const Block < const Char > &, Bool )>  ,
FromBlock  ,
"net.maxon.inputstreaminterface.fromblock"   
)