System::IO::BufferedStream class

BufferedStream class

Adds a buffering layer on top of another stream. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class BufferedStream : public System::IO::Stream

Methods

MethodDescription
BufferedStream(const SharedPtr<Stream>&)Constructs an BufferedStream object that wraps the specified stream and uses a 4096 bytes long buffer.
BufferedStream(const SharedPtr<Stream>&, int)Constructs an BufferedStream object that wraps the specified stream and uses a buffer of the specified size.
Flush() overrideWrites the content of the buffer to the underlying stream.
get_CanRead() const overrideDetermines if the stream is readable.
get_CanSeek() const overrideDetermines if the stream supports seeking.
get_CanWrite() const overrideDetermines if the stream is writable.
get_Length() const overrideReturns the length of the stream.
get_Position() const overrideReturns the current position of the stream.
Read(const ArrayPtr<uint8_t>&, int32_t, int32_t) overrideReads the specified number of bytes from the underlying stream and writes them to the specified byte array.
Read(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) overrideReads the specified number of bytes from the underlying stream and writes them to the specified byte array.
ReadByte() overrideReads a single byte from the underlying stream and returns a 32-bit integer value equivalent to the value of the read byte.
Seek(int64_t, SeekOrigin) overrideSets the position of the stream represented by the current object.
set_Position(int64_t) overrideFlushes the buffer to the underlying stream and then sets the stream’s position.
SetLength(int64_t) overrideSets the length of the stream represented by the current object.
Write(const ArrayPtr<uint8_t>&, int32_t, int32_t) overrideWrites the specified subrange of bytes from the specified byte array to the underlying stream.
Write(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) overrideWrites the specified subrange of bytes from the specified byte array to the underlying stream.
WriteByte(uint8_t) overrideWrites the specified unsigned 8-bit integer value to the underlying stream.
virtual ~BufferedStream()Destructor.

Fields

FieldDescription
static NullA stream with no underlying storage.

See Also