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

Creates a stream whose backing store is memory More...

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

Public Member Functions

 BufferedStream (intptr_t size=RLIB_DEFAULT_BUFFER_SIZE)
 Initializes a new instance of the BufferedStream class with a default buffer size More...
 
virtual void SetLength (intptr_t len) override
 Sets the length in bytes of the stream More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Length, GetLength, SetLength)
 Gets or sets the length in bytes of the stream More...
 
virtual void Close () override
 Closes the current stream and releases memory associated with the current stream More...
 
virtual intptr_t Write (LPCVOID buffer, intptr_t count) override
 Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written
 
virtual bool InheritFromBufferedStream () const overridefinal
 Identifies whether current class is a derived class of (or the same class as) BufferedStream More...
 
virtual RLIB_DEPRECATED void SetSize (intptr_t) overridefinal
 Sets the capacity in bytes of the stream. The method is deprecated and not supported currently More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Position, GetPos, SetPos)
 Gets or sets the position within the current stream More...
 
void ExChange (BufferedStream &)
 Swaps two BufferedStream instance(shallow move) More...
 
bool EnsureCapacity (intptr_t value)
 Ensures that the capacity of this instance is at least the specified value More...
 
void Move (intptr_t offsetTo, intptr_t offsetFrom, intptr_t bytes)
 Copies the bytes(<=size) from the location offsetTo to offsetFrom, and may change the length of stream. Copying takes place as if an intermediate buffer were used, allowing the destination and source to overlap. More...
 
- Public Member Functions inherited from System::IO::MemoryStream
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...
 
 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...
 
 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...
 
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...
 

Public Attributes

 RLIB_DECLARE_DYNCREATE
 

Additional Inherited Members

- Protected Member Functions inherited from System::IO::MemoryStream
intptr_t stream_move (intptr_t offsetTo, intptr_t offsetFrom, intptr_t bytes)
 
- Protected Attributes inherited from System::IO::MemoryStream
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

Constructor & Destructor Documentation

BufferedStream::BufferedStream ( intptr_t  size = RLIB_DEFAULT_BUFFER_SIZE)
explicit

Initializes a new instance of the BufferedStream class with a default buffer size

Member Function Documentation

void BufferedStream::Close ( )
overridevirtual

Closes the current stream and releases memory associated with the current stream

Implements System::IO::Stream.

bool BufferedStream::EnsureCapacity ( intptr_t  value)

Ensures that the capacity of this instance is at least the specified value

void BufferedStream::ExChange ( BufferedStream obj)

Swaps two BufferedStream instance(shallow move)

virtual bool System::IO::BufferedStream::InheritFromBufferedStream ( ) const
inlinefinaloverridevirtual

Identifies whether current class is a derived class of (or the same class as) BufferedStream

Implements System::IO::Stream.

void BufferedStream::Move ( intptr_t  offsetTo,
intptr_t  offsetFrom,
intptr_t  bytes 
)

Copies the bytes(<=size) from the location offsetTo to offsetFrom, and may change the length of stream. Copying takes place as if an intermediate buffer were used, allowing the destination and source to overlap.

System::IO::BufferedStream::RLIB_PROPERTY_GET_SET ( intptr_t  Length,
GetLength  ,
SetLength   
)

Gets or sets the length in bytes of the stream

System::IO::BufferedStream::RLIB_PROPERTY_GET_SET ( intptr_t  Position,
GetPos  ,
SetPos   
)

Gets or sets the position within the current stream

void BufferedStream::SetLength ( intptr_t  len)
overridevirtual

Sets the length in bytes of the stream

Parameters
len<size

Implements System::IO::Stream.

virtual RLIB_DEPRECATED void System::IO::BufferedStream::SetSize ( intptr_t  )
inlinefinaloverridevirtual

Sets the capacity in bytes of the stream. The method is deprecated and not supported currently

Implements System::IO::Stream.


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