nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.DataStorage.HDSPack / StreamBuffer

StreamBuffer

Full name Microsoft.VisualBasic.DataStorage.HDSPack.FileSystem.StreamBuffer Assembly Microsoft.VisualBasic.DataStorage.HDSPack Members 15

an in-memory stream buffer for write new file data

00 Remarks

size is limited to 2GB, use the IDisposable.Dispose() method for save the memory data to the underlying stream, and this dispose method will not close the target base stream

this model will append of the block data into the last of the physical file by default, or write to the specific location when in pre-allocation mode

01 Syntax

Microsoft.VisualBasic.DataStorage.HDSPack.FileSystem.StreamBuffer

02 Methods

NameOverloadsSummary
.ctor 1 create a new temp stream for write new object data
Flush 1
SetLength 1
Write 1
Read 1
Seek 1
writeBuffer 1 write the in-memory content data into the base file stream, and then update the stream block content data
Dispose 1 write the in-memory data to local file

03 Properties

NameOverloadsSummary
CanRead 1
CanSeek 1
CanWrite 1
Length 1
Position 1
IsPreallocated 1 current stream is fixed length?

04 Fields

NameOverloadsSummary
block 1 the file write behaviour is different at here based on the buffer information data in this file block reference object: 1.

05 Members

method .ctor #
#ctor(Stream, StreamBlock, Int32)

create a new temp stream for write new object data

Remarks

all stream data before flush into file is in-memory, so one block file its file size should be less then 2GB.

Parameters
NameTypeDescription
bufferStream

-

blockStreamBlock

the block location of current file data

buffer_sizeInt32

-

method Flush #
Flush
method SetLength #
SetLength(Int64)
method Write #
Write(Byte(), Int32, Int32)
method Read #
Read(Byte(), Int32, Int32)
method Seek #
Seek(Int64, SeekOrigin)
method writeBuffer #
writeBuffer

write the in-memory content data into the base file stream, and then update the stream block content data

Remarks

append current file block object to the last of the file by default when flush the data to physical pack file

method Dispose #
Dispose(Boolean)

write the in-memory data to local file

Parameters
NameTypeDescription
disposingBoolean

-

property CanRead #
CanRead
property CanSeek #
CanSeek
property CanWrite #
CanWrite
property Length #
Length
property Position #
Position
property IsPreallocated #
IsPreallocated

current stream is fixed length?

field block #
block

the file write behaviour is different at here based on the buffer information data in this file block reference object:

  1. if the file block information is empty: no position and no size, then file data will be append to the stream last
  2. if the file block information is not empty, then file data will be write to a specific location, and then length of the stream data is fixed!