Class DataProvider
Summary description for DataProvider.
Implements
Inherited Members
Namespace: Syncfusion.XlsIO.Parser.Biff_Records
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public abstract class DataProvider : IDisposable
Constructors
DataProvider()
Default constructor.
Declaration
public DataProvider()
Properties
Capacity
Returns size of the internal buffer. Read-only.
Declaration
public abstract int Capacity { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsCleared
Indicates whether data provider was cleared.
Declaration
public abstract bool IsCleared { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Clear()
Clears internal storage if allowed.
Declaration
public abstract void Clear()
CopyMemory(Int32, Int32, Int32)
Copies memory inside internal buffer.
Declaration
public abstract void CopyMemory(int iDestOffset, int iSourceOffset, int iMemorySize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iDestOffset | Destination offset. |
System.Int32 | iSourceOffset | Source offset. |
System.Int32 | iMemorySize | Memory size. |
CopyTo(Int32, DataProvider, Int32, Int32)
Copies data from internal storage into specified provider.
Declaration
public virtual void CopyTo(int iSourceOffset, DataProvider destination, int iDestOffset, int iLength)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iSourceOffset | Source offset. |
DataProvider | destination | Destination provider. |
System.Int32 | iDestOffset | Destination offset. |
System.Int32 | iLength | Size in bytes of the data to copy. |
CopyTo(Int32, Byte[], Int32, Int32)
Copies data from internal storage into specified data array.
Declaration
public abstract void CopyTo(int iSourceOffset, byte[] arrDestination, int iDestOffset, int iLength)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iSourceOffset | Source offset. |
System.Byte[] | arrDestination | Destination array. |
System.Int32 | iDestOffset | Destination offset. |
System.Int32 | iLength | Size in bytes of the data to copy. |
CreateProvider()
Creates data provider of the same type.
Declaration
public abstract DataProvider CreateProvider()
Returns
Type | Description |
---|---|
DataProvider | Created data provider. |
Dispose()
Dispose DataProvider
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
public void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDisposing |
EnsureCapacity(Int32)
Resizes internal storage if necessary.
Declaration
public abstract int EnsureCapacity(int size)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | size | Required size. |
Returns
Type | Description |
---|---|
System.Int32 |
EnsureCapacity(Int32, Int32)
Resizes internal storage if necessary.
Declaration
public abstract int EnsureCapacity(int size, int forceAdd)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | size | |
System.Int32 | forceAdd |
Returns
Type | Description |
---|---|
System.Int32 |
Finalize()
Declaration
protected void Finalize()
MoveMemory(Int32, Int32, Int32)
Moves memory inside internal buffer.
Declaration
public abstract void MoveMemory(int iDestOffset, int iSourceOffset, int iMemorySize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iDestOffset | Destination offset. |
System.Int32 | iSourceOffset | Source offset. |
System.Int32 | iMemorySize | Memory size. |
OnDispose()
Declaration
protected virtual void OnDispose()
Read(BinaryReader, Int32, Int32, Byte[])
Reads data from BinaryReader.
Declaration
public abstract void Read(BinaryReader reader, int iOffset, int iLength, byte[] arrBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryReader | reader | Reader to get data from. |
System.Int32 | iOffset | Offset in the internal data to start filling from. |
System.Int32 | iLength | Number of bytes to read. |
System.Byte[] | arrBuffer | Temporary buffer to use. |
Read(BinaryReader, Int32, Int32, Byte[], IDecryptor)
Reads data from BinaryReader.
Declaration
public void Read(BinaryReader reader, int iOffset, int iLength, byte[] arrBuffer, IDecryptor decryptor)
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryReader | reader | Reader to get data from. |
System.Int32 | iOffset | Offset in the internal data to start filling from. |
System.Int32 | iLength | Number of bytes to read. |
System.Byte[] | arrBuffer | Temporary buffer to use. |
IDecryptor | decryptor | Object used to decrypt data if necessary. |
ReadAddr(Int32)
Gets TAddr structure from internal data.
Declaration
[CLSCompliant(false)]
public TAddr ReadAddr(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset in bytes of TAddr structure to get. |
Returns
Type | Description |
---|---|
TAddr | Retrieved TAddr structure. |
ReadAddrAsRectangle(Int32)
Gets TAddr structure from internal data.
Declaration
public Rectangle ReadAddrAsRectangle(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset in bytes of TAddr structure to get. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | Retrieved TAddr structure. |
ReadArray(Int32, Byte[])
Reads data array from another data array.
Declaration
public int ReadArray(int iOffset, byte[] arrDest)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Source offset. |
System.Byte[] | arrDest | Destination array. |
Returns
Type | Description |
---|---|
System.Int32 | Updated source offset. |
ReadArray(Int32, Byte[], Int32)
Reads data array from another data array.
Declaration
public int ReadArray(int iOffset, byte[] arrDest, int size)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Source offset. |
System.Byte[] | arrDest | Destination array. |
System.Int32 | size | Number of bytes to read. |
Returns
Type | Description |
---|---|
System.Int32 | Updated source offset. |
ReadBit(Int32, Int32)
Returns bit value at the specified position.
Declaration
public bool ReadBit(int iOffset, int iBit)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
System.Int32 | iBit | Bit index in the byte. |
Returns
Type | Description |
---|---|
System.Boolean | Bit at the specified position. |
ReadBoolean(Int32)
Returns boolean value at the specified position.
Declaration
public bool ReadBoolean(int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
Returns
Type | Description |
---|---|
System.Boolean | Byte at the specified position. |
ReadByte(Int32)
Returns byte value at the specified position.
Declaration
public abstract byte ReadByte(int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
Returns
Type | Description |
---|---|
System.Byte | Byte at the specified position. |
ReadDouble(Int32)
Returns Int32 value at the specified position.
Declaration
public virtual double ReadDouble(int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
Returns
Type | Description |
---|---|
System.Double | Int32 value at the specified position. |
ReadInt16(Int32)
Returns Int16 value at the specified position.
Declaration
public abstract short ReadInt16(int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
Returns
Type | Description |
---|---|
System.Int16 | Int16 value at the specified position. |
ReadInt32(Int32)
Returns Int32 value at the specified position.
Declaration
public abstract int ReadInt32(int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
Returns
Type | Description |
---|---|
System.Int32 | Int32 value at the specified position. |
ReadInt64(Int32)
Returns Int32 value at the specified position.
Declaration
public abstract long ReadInt64(int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
Returns
Type | Description |
---|---|
System.Int64 | Int32 value at the specified position. |
ReadString(Int32, Int32, out Int32, Boolean)
Gets string from internal record data using GetBytes.
Declaration
public string ReadString(int offset, int iStrLen, out int iBytesInString, bool isByteCounted)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset of starting byte. |
System.Int32 | iStrLen | Length of the string. |
System.Int32 | iBytesInString | Gets bytes count that this string occupies in the data array. |
System.Boolean | isByteCounted | Flags that represent is bytes count available. |
Returns
Type | Description |
---|---|
System.String | Retrieved string. |
ReadString(Int32, Int32, Encoding, Boolean)
Reads string from data provider.
Declaration
public abstract string ReadString(int offset, int stringLength, Encoding encoding, bool isUnicode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset to the first character. |
System.Int32 | stringLength | Number of bytes in the string. |
System.Text.Encoding | encoding | Encoding to use. |
System.Boolean | isUnicode | Indicates whether string is unicode. |
Returns
Type | Description |
---|---|
System.String | Extracted string. |
ReadString16Bit(Int32, out Int32)
Gets string from internal data and returns it's length in iFullLength parameter.
Declaration
public virtual string ReadString16Bit(int iOffset, out int iFullLength)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the string data. |
System.Int32 | iFullLength | Length of the string in bytes. |
Returns
Type | Description |
---|---|
System.String | Parsed string. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | When data array is smaller than the string that should be in it. |
ReadString16BitUpdateOffset(ref Int32)
Gets string from internal data and updates offset.
Declaration
public virtual string ReadString16BitUpdateOffset(ref int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the string data. |
Returns
Type | Description |
---|---|
System.String | Parsed string. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | When data array is smaller than the string that should be in it. |
ReadString8Bit(Int32, out Int32)
Gets string from byte array and returns it's length in iFullLength parameter.
Declaration
public virtual string ReadString8Bit(int iOffset, out int iFullLength)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the string data. |
System.Int32 | iFullLength | Length of the string in bytes. |
Returns
Type | Description |
---|---|
System.String | Parsed string. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | When data array is smaller than the string that should be in it. |
ReadStringUpdateOffset(ref Int32, Int32)
Gets string from internal record data using GetBytes and it increases offset by string size in bytes.
Declaration
public string ReadStringUpdateOffset(ref int offset, int iStrLen)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset of starting byte. |
System.Int32 | iStrLen | Length of the string. |
Returns
Type | Description |
---|---|
System.String | Retrieved string. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | if Offset + iStrLen is out of data array |
ReadUInt16(Int32)
Returns UInt16 value at the specified position.
Declaration
[CLSCompliant(false)]
public ushort ReadUInt16(int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
Returns
Type | Description |
---|---|
System.UInt16 | Int16 value at the specified position. |
ReadUInt32(Int32)
Returns Int32 value at the specified position.
Declaration
[CLSCompliant(false)]
public uint ReadUInt32(int iOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
Returns
Type | Description |
---|---|
System.UInt32 | Int32 value at the specified position. |
WriteAddr(Int32, TAddr)
Sets TAddr structure in internal record data.
Declaration
[CLSCompliant(false)]
protected void WriteAddr(int offset, TAddr addr)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset in bytes of TAddr structure to set. |
TAddr | addr | New value of the TAddr at the specified position. |
WriteAddr(Int32, Rectangle)
Sets TAddr structure in internal record data.
Declaration
protected void WriteAddr(int offset, Rectangle addr)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset in bytes of TAddr structure to set. |
System.Drawing.Rectangle | addr | New value of the Rectangle at the specified position. |
WriteBit(Int32, Boolean, Int32)
Sets one bit in specified byte in internal record data array.
Declaration
public abstract void WriteBit(int offset, bool value, int bitPos)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset of the byte in the data array. |
System.Boolean | value | Value of bit. |
System.Int32 | bitPos | Bit position in the byte. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | If bitPos is less than zero or more than 7. |
WriteByte(Int32, Byte)
Writes byte value at the specified position.
Declaration
public abstract void WriteByte(int iOffset, byte value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
System.Byte | value | Byte value to write at the specified position. |
WriteBytes(Int32, Byte[])
Sets bytes in internal record data array values.
Declaration
public void WriteBytes(int offset, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset in internal record data array to start from. |
System.Byte[] | data | Array of bytes to set. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | If value array is NULL. |
System.ArgumentOutOfRangeException | If pos or length would be less than zero or their sum would be more than size of value array. |
System.ArgumentOutOfRangeException | If internal record data array is too small for receiving value array and AutoGrowData is False. |
WriteBytes(Int32, Byte[], Int32, Int32)
Sets bytes in internal record data array values.
Declaration
public abstract void WriteBytes(int offset, byte[] value, int pos, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset in internal record data array to start from. |
System.Byte[] | value | Array of bytes to set. |
System.Int32 | pos | Position in value array to the data that will be set. |
System.Int32 | length | Length of the data. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | If value array is NULL. |
System.ArgumentOutOfRangeException | If pos or length would be less than zero or their sum would be more than size of value array. |
System.ArgumentOutOfRangeException | If internal record data array is too small for receiving value array and AutoGrowData is False. |
WriteDouble(Int32, Double)
Writes Double value at the specified position.
Declaration
public abstract void WriteDouble(int iOffset, double value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
System.Double | value | Double value to write at the specified position. |
WriteInt16(Int32, Int16)
Writes Int16 value at the specified position.
Declaration
public abstract void WriteInt16(int iOffset, short value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
System.Int16 | value | Int16 value to write at the specified position. |
WriteInt32(Int32, Int32)
Writes Int16 value at the specified position.
Declaration
public abstract void WriteInt32(int iOffset, int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
System.Int32 | value | Int32 value to write at the specified position. |
WriteInt64(Int32, Int64)
Writes Int16 value at the specified position.
Declaration
public abstract void WriteInt64(int iOffset, long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
System.Int64 | value | Int32 value to write at the specified position. |
WriteInto(BinaryWriter, Int32, Int32, Byte[])
Saves data into binary writer.
Declaration
public virtual void WriteInto(BinaryWriter writer, int iOffset, int iSize, byte[] arrBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryWriter | writer | Writer to save data into. |
System.Int32 | iOffset | Start offset in the internal storage. |
System.Int32 | iSize | Number of bytes to save. |
System.Byte[] | arrBuffer | Temporary buffer to use. |
WriteString16Bit(Int32, String)
Sets string in internal data. The String length is saved in two bytes.
Declaration
public int WriteString16Bit(int offset, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset to the string. |
System.String | value | Value of the string. |
Returns
Type | Description |
---|---|
System.Int32 | Size of the written data. |
WriteString16Bit(Int32, String, Boolean)
Sets string in internal data. The String length is saved in two bytes.
Declaration
public int WriteString16Bit(int offset, string value, bool isUnicode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset to the string. |
System.String | value | Value of the string. |
System.Boolean | isUnicode | Indicates whether string should be stored in unicode format. |
Returns
Type | Description |
---|---|
System.Int32 | Size of the written data. |
WriteString16BitUpdateOffset(ref Int32, String)
Sets string in internal data. The String length is saved in two bytes.
Declaration
public void WriteString16BitUpdateOffset(ref int offset, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset to the string. |
System.String | value | Value of the string. |
WriteString16BitUpdateOffset(ref Int32, String, Boolean)
Sets string in internal data. The String length is saved in two bytes.
Declaration
public void WriteString16BitUpdateOffset(ref int offset, string value, bool isUnicode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset to the string. |
System.String | value | Value of the string. |
System.Boolean | isUnicode | Indicates whether string should be stored as unicode. |
WriteString8BitUpdateOffset(ref Int32, String)
Sets string in internal data. The String length is saved in two bytes.
Declaration
public void WriteString8BitUpdateOffset(ref int offset, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset to the string. |
System.String | value | Value of the string. |
WriteStringNoLenUpdateOffset(ref Int32, String)
Sets string in internal record data without string length, updates offset parameter (adds string length).
Declaration
public virtual void WriteStringNoLenUpdateOffset(ref int offset, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset to the string. |
System.String | value | Value of the string. |
WriteStringNoLenUpdateOffset(ref Int32, String, Boolean)
Sets string in internal record data without string length, updates offset parameter (adds string length).
Declaration
public abstract void WriteStringNoLenUpdateOffset(ref int offset, string value, bool bUnicode)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | Offset to the string. |
System.String | value | Value of the string. |
System.Boolean | bUnicode | Indicates whether string should be stored in Unicode encoding or not. |
WriteUInt16(Int32, UInt16)
Writes Int16 value at the specified position.
Declaration
[CLSCompliant(false)]
public virtual void WriteUInt16(int iOffset, ushort value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
System.UInt16 | value | Int16 value to write at the specified position. |
WriteUInt32(Int32, UInt32)
Writes Int16 value at the specified position.
Declaration
[CLSCompliant(false)]
public void WriteUInt32(int iOffset, uint value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iOffset | Offset to the required value. |
System.UInt32 | value | Int32 value to write at the specified position. |
ZeroMemory()
Writes zeros inside memory block.
Declaration
public abstract void ZeroMemory()