Sample code for 30+ languages & platforms
C#

Load Entire File into BinData

Demonstrates how to load an entire file into a BinData object.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.FileAccess fac = new Chilkat.FileAccess();

success = fac.OpenForRead("qa_data/pdf/sample.pdf");
if (success == false) {
    Debug.WriteLine(fac.LastErrorText);
    return;
}

Chilkat.BinData bd = new Chilkat.BinData();
int maxBytesToRead = 99999999;
success = fac.FileReadBd(maxBytesToRead,bd);
if (success == false) {
    Debug.WriteLine(fac.LastErrorText);
    return;
}

fac.FileClose();

//  The bd object contains the file data...
success = bd.WriteFile("qa_output/sample.pdf");