ReturnBytes
Returns the raw byte array loaded from the resource file.
Syntax: object.ReturnBytes() As Byte()
Returns a Byte() containing every byte of the resource data loaded by the preceding Read call. If Read has not been called, the returned array is unallocated and has no elements.
Remarks
ReturnBytes is the lowest-level retrieval method on cRes. The other retrieval methods—ReturnString, ReturnHex, ReturnBase64, and ReturnPicture—all derive their output from the same internal byte array that ReturnBytes exposes directly.
The returned array is a copy of the internal storage; modifying it does not affect the cRes instance.
Example
This example loads a binary resource and writes it to a file.
Dim res As New cRes
res.Read "MyData", "BINARY"
Dim b() As Byte
b = res.ReturnBytes()
Dim fileNum As Integer
fileNum = FreeFile()
Open "C:\output\data.bin" For Binary Access Write As #fileNum
Put #fileNum, , b
Close #fileNum
See Also
- Read method
- ReturnString method
- ReturnHex method
- ReturnBase64 method
- ReturnPicture method