Class TBinaryNCFile
Some class to use for writing binary files. It automatically synchronizes with the postprocessing system and, when debugging via CLDViewer, allows you to see how the contents of the file change right during the writing process. It also implements the functionality of insertion to an arbitrary location in the file (at the beginning or middle, and not just at the end).
Namespace: DotnetPostprocessing.SDK
Assembly: DotnetPostprocessing.SDK.dll
Syntax
public class TBinaryNCFile : TNCFile
Constructors
TBinaryNCFile()
Initializes a new instance of TBinaryNCFile and assigns TNCFilesManager.Singletone.DefaultNCFilesOwner
as an
Owner.
Declaration
public TBinaryNCFile()
TBinaryNCFile(INCFileOwner)
Initializes a new instance of TBinaryNCFile object and assigns specified object as an Owner.
Declaration
public TBinaryNCFile(INCFileOwner Owner)
Parameters
Type | Name | Description |
---|---|---|
INCFileOwner | Owner | The object that is the owner of the output file formed by the postprocessor. Usually the owner is a postprocessor itself. |
Properties
Description
Short textual description of the file's content to be shown for the user in CAM's window instead of hexadecimal representation of its bytes.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
OutputFileName
The file name with a full path where this output file should be saved at the finish.
Declaration
public override string OutputFileName { get; set; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
SaveToFile(string)
This method is called by the system automatically at the most final stage of the postprocessor's work. Here the content of the file should be written from a temporary storage (in memory or temporary file) to the destination file specified in the OutputFileName property.
After this saving the OnFinalizeNCFiles(TNCFilesManager) handler of the postprocessor is called where you can implement some additional actions on the output files.
Declaration
public override void SaveToFile(string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | fileName | The destination file path. |
Overrides
Write(byte[], long, int)
Writes only the subrange of the specified array of bytes to the end of the file.
Declaration
public void Write(byte[] b, long offset, int count)
Parameters
Type | Name | Description |
---|---|---|
byte[] | b | The array of bytes to write. |
long | offset | Offset of the first writing byte of the b array. |
int | count | The count of bytes to write. |
Write(byte[])
Writes specified array of bytes to the end of the file.
Declaration
public void Write(byte[] b)
Parameters
Type | Name | Description |
---|---|---|
byte[] | b | The array of bytes to write. |
Write(ReadOnlySpan<byte>)
Writes the specified buffer of bytes System.ReadOnlySpan<> to the end of the file.
Declaration
public void Write(ReadOnlySpan<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<><byte> | buffer | The span of bytes to write. |