asData
- function
- The asData() function is most commonly called using the as data operator.
For example, the raw binary contents of a file or URL can be accessed using as data:
set myData to file "/tmp/data" as data
It is also possible to write binary data to a file:
put myData as data into file "/tmp/data"
• When two known binary data values are compared for equality, they are compared byte for byte to see that they have exactly the same binary contents.
• When values are converted between text and binary data, the current setting of the defaultStringEncoding global property is used to determine the encoding to be used.
- Related: defaultStringEncoding