Sample code for 30+ languages & platforms
Xojo Plugin

Load Entire File into BinData

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

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim fac As New Chilkat.FileAccess

success = fac.OpenForRead("qa_data/pdf/sample.pdf")
If (success = False) Then
    System.DebugLog(fac.LastErrorText)
    Return
End If

Dim bd As New Chilkat.BinData
Dim maxBytesToRead As Int32
maxBytesToRead = 99999999
success = fac.FileReadBd(maxBytesToRead,bd)
If (success = False) Then
    System.DebugLog(fac.LastErrorText)
    Return
End If

fac.FileClose 

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