Class FileByteProvider
Byte provider for (big) files.
Inherited Members
Namespace: Be.Windows.Forms
Assembly: Be.Windows.Forms.HexBox.dll
Syntax
public class FileByteProvider : IByteProvider, IDisposable
Constructors
View SourceFileByteProvider(string)
Initializes a new instance of the FileByteProvider class.
Declaration
public FileByteProvider(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName |
Properties
View SourceFileName
Gets the name of the file the byte provider is using.
Declaration
public string FileName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Length
Gets the length of the file.
Declaration
public long Length { get; }
Property Value
| Type | Description |
|---|---|
| long |
Methods
View SourceApplyChanges()
Updates the file with all changes the write buffer contains.
Declaration
public void ApplyChanges()
DeleteBytes(long, long)
Not supported
Declaration
public void DeleteBytes(long index, long length)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index | |
| long | length |
Dispose()
Releases the file handle used by the FileByteProvider.
Declaration
public void Dispose()
~FileByteProvider()
Terminates the instance of the FileByteProvider class.
Declaration
protected ~FileByteProvider()
HasChanges()
Returns a value if there are some changes.
Declaration
public bool HasChanges()
Returns
| Type | Description |
|---|---|
| bool | true, if there are some changes |
InsertBytes(long, byte[])
Not supported
Declaration
public void InsertBytes(long index, byte[] bs)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index | |
| byte[] | bs |
ReadByte(long)
Reads a byte from the file.
Declaration
public byte ReadByte(long index)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index | the index of the byte to read |
Returns
| Type | Description |
|---|---|
| byte | the byte |
RejectChanges()
Clears the write buffer and reject all changes made.
Declaration
public void RejectChanges()
SupportsDeleteBytes()
Returns false
Declaration
public bool SupportsDeleteBytes()
Returns
| Type | Description |
|---|---|
| bool |
SupportsInsertBytes()
Returns false
Declaration
public bool SupportsInsertBytes()
Returns
| Type | Description |
|---|---|
| bool |
SupportsWriteByte()
Returns true
Declaration
public bool SupportsWriteByte()
Returns
| Type | Description |
|---|---|
| bool |
WriteByte(long, byte)
Writes a byte into write buffer
Declaration
public void WriteByte(long index, byte value)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index | |
| byte | value |
Events
View SourceChanged
Occurs, when the write buffer contains new changes.
Declaration
public event EventHandler Changed
Event Type
| Type | Description |
|---|---|
| EventHandler |
LengthChanged
Never used.
Declaration
public event EventHandler LengthChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |