Interface IStreamProvider
Interface for the
Namespace: SuperOffice.IO
Assembly: SoCore.dll
Syntax
public interface IStreamProvider
Properties
Length
Length (in bytes) of the document.
Declaration
long Length { get; }
Property Value
Type | Description |
---|---|
Int64 |
Methods
BeginRead()
Start reading the document.
Declaration
void BeginRead()
Remarks
Read bytes from the document using the Read(Int64, Byte[], Int32, Int32) method.
Call the EndRead() method to specify that you are
finished reading the document.
BeginWrite()
Start writing the document file.
Declaration
void BeginWrite()
Remarks
Use the Write(Int64, Byte[], Int32, Int32) method to write data to the file.
As data might be written to a temporary location, the EndWrite()
will archive the document to the document archive.
EndRead()
Express that you are finished reading the file. If the file is read from a temporary location, it will be removed from it.
Declaration
void EndRead()
EndWrite()
Specify that the writing of the document is completed and that the document can be archived in the document archive.
Declaration
void EndWrite()
Read(Int64, Byte[], Int32, Int32)
Read data from the document
Declaration
int Read(long filePosition, byte[] buffer, int bufferStartPosition, int lenght)
Parameters
Type | Name | Description |
---|---|---|
Int64 | filePosition | Position in the file to start reading from. |
Byte[] | buffer | Buffer to put the data read. |
Int32 | bufferStartPosition | Position in buffer to start filling it. |
Int32 | lenght | Number of bytes to read from the file. |
Returns
Type | Description |
---|---|
Int32 | Number of bytes actually read from the file. This should only be less then the file when the end of file is reached. |
Remarks
BeginRead() must be called before this method. It is not requred that BeginRead() is called within the scope of this method. It is required that it is called on bahalf of the same user and on the same document and that either this method or BeginRead() is called during the last time period specified in the configuration. Default time period is 24 hours.
Write(Int64, Byte[], Int32, Int32)
Write a block of data to a file.
Declaration
void Write(long filePosition, byte[] buffer, int bufferStartPosition, int lenght)
Parameters
Type | Name | Description |
---|---|---|
Int64 | filePosition | Position in the file to start writing |
Byte[] | buffer | Buffer to write |
Int32 | bufferStartPosition | Position in the buffer to start writing from. |
Int32 | lenght | Number of bytes to write from the buffer. |
Remarks
BeginWrite() must be called before this method. It is not requred that BeginWrite() is called within the scope of this method. It is required that it is called on bahalf of the same user and on the same document and that either this method or BeginWrite() is called during the last time period specified in the configuration. Default time period is 24 hours.