BinaryChunk
Namespace: Casasoft.IF.GBlorbLib
Represents a binary chunk of data.
public class BinaryChunk : Chunk, IChunk
Inheritance Object → Chunk → BinaryChunk
Implements IChunk
Attributes NullableContextAttribute, NullableAttribute
Properties
Content
Gets or sets the content of the binary chunk.
public Byte[] Content { get; set; }
Property Value
Name
Gets or sets the name of the chunk.
public string Name { get; set; }
Property Value
Length
Gets or sets the length of the chunk.
public int Length { get; set; }
Property Value
Address
Gets or sets the address of the chunk.
public int Address { get; set; }
Property Value
ResourceID
Gets or sets the resource ID of the chunk.
public int ResourceID { get; set; }
Property Value
Constructors
BinaryChunk()
Initializes a new instance of the BinaryChunk class with a default name.
public BinaryChunk()
BinaryChunk(String)
Initializes a new instance of the BinaryChunk class with the specified name.
public BinaryChunk(string name)
Parameters
name
String
The name of the binary chunk.
BinaryChunk(Byte[], Int32)
Initializes a new instance of the BinaryChunk class with the specified data and offset.
public BinaryChunk(Byte[] data, int offset)
Parameters
data
Byte[]
The byte array containing the chunk data.
offset
Int32
The offset within the byte array where the chunk starts.
Methods
Export(String)
Exports the binary chunk to the specified file.
public void Export(string filename)
Parameters
filename
String
The name of the file to export to.
Write(Byte[], Int32)
Writes the binary chunk data to the specified byte array at the given offset.
public void Write(Byte[] data, int offset)
Parameters
data
Byte[]
The byte array to write the chunk data to.
offset
Int32
The offset within the byte array where the chunk data should be written.
IsResource()
Determines whether the chunk is a resource.
public bool IsResource()
Returns
Boolean
true
if the chunk is a resource; otherwise, false
.
FileExtension()
Gets the file extension for the binary chunk based on its name.
public string FileExtension()
Returns
String
The file extension for the binary chunk.
ResourceType()
Gets the resource type of the chunk based on its name.
public string ResourceType()
Returns
String
Resource type or empty string if unknown