RLib  5.7
RLib - an opensource, lightweight and multi-platform framework for cpp programming
System::IO::MemoryStream Class Reference

Creates a stream whose backing store is memory. This is an abstract class More...

Inheritance diagram for System::IO::MemoryStream:
System::IO::Stream System::IO::BufferedStream System::IO::UnmanagedMemoryStream

Public Member Functions

virtual intptr_t GetSize () const override
 Gets the capacity in bytes of the stream More...
 
virtual intptr_t GetLength () const override
 Gets the length in bytes of the stream More...
 
virtual intptr_t GetPos () const override
 Gets the position within the current stream More...
 
virtual void SetPos (intptr_t Pos) override
 Sets the position within the current stream More...
 
virtual intptr_t Read (LPVOID buffer, intptr_t count) const override
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read More...
 
virtual bool InheritFromMemoryStream () const overridefinal
 identifies whether current class is a derived class of (or the same class as) MemoryStream More...
 
LPVOID GetObjectData () const
 Gets the pointer of bytes from which this stream was created More...
 
 RLIB_PROPERTY_GET (LPVOID ObjectData, GetObjectData)
 Gets the pointer of bytes from which this stream was created More...
 
void * GetCurrentPtr () const
 Gets the pointer of bytes at the current position More...
 
 RLIB_PROPERTY_GET (void *CurrentPtr, GetCurrentPtr)
 Gets the pointer of bytes at the current position More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Capacity, GetSize, SetSize)
 Gets or sets the number of bytes allocated for this object More...
 
- Public Member Functions inherited from System::IO::Stream
 RLIB_PROPERTY_GET_SET (intptr_t Position, GetPos, SetPos)
 When overridden in a derived class, gets or sets the position within the current stream More...
 
virtual void SetSize (intptr_t size)=0
 When overridden in a derived class, sets the capacity in bytes of the stream More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Size, GetSize, SetSize)
 When overridden in a derived class, gets or sets the capacity in bytes of the stream More...
 
virtual void SetLength (intptr_t len)=0
 When overridden in a derived class, sets the length in bytes of the stream More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Length, GetLength, SetLength)
 When overridden in a derived class, gets or sets the length in bytes of the stream More...
 
virtual intptr_t Write (LPCVOID buffer, intptr_t count)=0
 When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written More...
 
virtual void Close ()=0
 When overridden in a derived class, Closes the current stream and releases any resources associated with the current stream More...
 
virtual bool InheritFromBufferedStream () const =0
 When overridden in a derived class, identifies whether current class is a derived class of (or the same class as) BufferedStream More...
 
intptr_t GetMaxReadSize () const
 Gets the maximum bytes of readable data from current position More...
 
 RLIB_PROPERTY_GET (intptr_t MaxReadSize, GetMaxReadSize)
 Gets the maximum bytes of readable data from current position More...
 
intptr_t GetMaxWriteSize () const
 Gets the maximum writeable bytes from current position, based on current capacity More...
 
 RLIB_PROPERTY_GET (intptr_t MaxWriteSize, GetMaxWriteSize)
 Gets the maximum writeable bytes from current position, based on current capacity More...
 
void CopyTo (Stream *destination, intptr_t bufferSize=RLIB_DEFAULT_BUFFER_SIZE) const
 Reads the bytes from the current stream and writes them to another stream, using a specified buffer size More...
 

Protected Member Functions

intptr_t stream_move (intptr_t offsetTo, intptr_t offsetFrom, intptr_t bytes)
 

Protected Attributes

LPVOID m_buffer
 
intptr_t m_pos
 
intptr_t m_length
 
union {
   intptr_t   m_size
 
   intptr_t   m_capacity
 
}; 
 

Detailed Description

Creates a stream whose backing store is memory. This is an abstract class

Member Function Documentation

void* System::IO::MemoryStream::GetCurrentPtr ( ) const
inline

Gets the pointer of bytes at the current position

virtual intptr_t System::IO::MemoryStream::GetLength ( ) const
inlineoverridevirtual

Gets the length in bytes of the stream

Implements System::IO::Stream.

LPVOID System::IO::MemoryStream::GetObjectData ( ) const
inline

Gets the pointer of bytes from which this stream was created

virtual intptr_t System::IO::MemoryStream::GetPos ( ) const
inlineoverridevirtual

Gets the position within the current stream

Implements System::IO::Stream.

virtual intptr_t System::IO::MemoryStream::GetSize ( ) const
inlineoverridevirtual

Gets the capacity in bytes of the stream

Implements System::IO::Stream.

virtual bool System::IO::MemoryStream::InheritFromMemoryStream ( ) const
inlinefinaloverridevirtual

identifies whether current class is a derived class of (or the same class as) MemoryStream

Implements System::IO::Stream.

intptr_t MemoryStream::Read ( LPVOID  buffer,
intptr_t  count 
) const
overridevirtual

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read

Returns
The total number of bytes read into the buffer.This can be less than the number of bytes requested if that many bytes are not currently available, or -1 if any exception occurred

Implements System::IO::Stream.

System::IO::MemoryStream::RLIB_PROPERTY_GET ( LPVOID  ObjectData,
GetObjectData   
)

Gets the pointer of bytes from which this stream was created

System::IO::MemoryStream::RLIB_PROPERTY_GET ( void *  CurrentPtr,
GetCurrentPtr   
)

Gets the pointer of bytes at the current position

System::IO::MemoryStream::RLIB_PROPERTY_GET_SET ( intptr_t  Capacity,
GetSize  ,
SetSize   
)

Gets or sets the number of bytes allocated for this object

void MemoryStream::SetPos ( intptr_t  Pos)
overridevirtual

Sets the position within the current stream

Implements System::IO::Stream.


The documentation for this class was generated from the following files: