Class DynamicFileByteProvider
Implements a fully editable byte provider for file data of any size.
Inherited Members
Namespace: Be.Windows.Forms
Assembly: Be.Windows.Forms.HexBox.dll
Syntax
public sealed class DynamicFileByteProvider : IByteProvider, IDisposable
Remarks
Only changes to the file are stored in memory with reads from the original data occurring as required.
Constructors
View SourceDynamicFileByteProvider(Stream)
Constructs a new DynamicFileByteProvider instance.
Declaration
public DynamicFileByteProvider(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | the stream containing the data. |
Remarks
The stream must supported seek operations.
DynamicFileByteProvider(string)
Constructs a new DynamicFileByteProvider instance.
Declaration
public DynamicFileByteProvider(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | The name of the file from which bytes should be provided. |
DynamicFileByteProvider(string, bool)
Constructs a new DynamicFileByteProvider instance.
Declaration
public DynamicFileByteProvider(string fileName, bool readOnly)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | The name of the file from which bytes should be provided. |
| bool | readOnly | True, opens the file in read-only mode. |
Properties
View SourceLength
See Length for more information.
Declaration
public long Length { get; }
Property Value
| Type | Description |
|---|---|
| long |
ReadOnly
Gets a value, if the file is opened in read-only mode.
Declaration
public bool ReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceApplyChanges()
See ApplyChanges() for more information.
Declaration
public void ApplyChanges()
DeleteBytes(long, long)
See DeleteBytes(long, long) for more information.
Declaration
public void DeleteBytes(long index, long length)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index | |
| long | length |
Dispose()
See Dispose() for more information.
Declaration
public void Dispose()
~DynamicFileByteProvider()
See ~Object() for more information.
Declaration
protected ~DynamicFileByteProvider()
HasChanges()
See HasChanges() for more information.
Declaration
public bool HasChanges()
Returns
| Type | Description |
|---|---|
| bool |
InsertBytes(long, byte[])
See InsertBytes(long, byte[]) for more information.
Declaration
public void InsertBytes(long index, byte[] bs)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index | |
| byte[] | bs |
ReadByte(long)
See ReadByte(long) for more information.
Declaration
public byte ReadByte(long index)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index |
Returns
| Type | Description |
|---|---|
| byte |
SupportsDeleteBytes()
See SupportsDeleteBytes() for more information.
Declaration
public bool SupportsDeleteBytes()
Returns
| Type | Description |
|---|---|
| bool |
SupportsInsertBytes()
See SupportsInsertBytes() for more information.
Declaration
public bool SupportsInsertBytes()
Returns
| Type | Description |
|---|---|
| bool |
SupportsWriteByte()
See SupportsWriteByte() for more information.
Declaration
public bool SupportsWriteByte()
Returns
| Type | Description |
|---|---|
| bool |
WriteByte(long, byte)
See WriteByte(long, byte) for more information.
Declaration
public void WriteByte(long index, byte value)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index | |
| byte | value |
Events
View SourceChanged
See Changed for more information.
Declaration
public event EventHandler Changed
Event Type
| Type | Description |
|---|---|
| EventHandler |
LengthChanged
See LengthChanged for more information.
Declaration
public event EventHandler LengthChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |