# bytes(a)

Converts data to the bytes as written on disk.

### Syntax

o_bytes(a)
  a: scalar any
  return: an array of bytes matching what would be written in binary on disk

### Usage

At times it is useful to examine the details of binary data. Traditionally in VEE the process would be to write the data to a file on disk in binary format and then read in the bytes. Using file IO like this can be fragile and is slow at best. This object bypasses the file IO and creates the bytes directly within VEE. And since it does not use loops, it is very fast.

### Location

menu: veeos ==> Data ==> bytes

library: dataLib

### Example

`o_bytes(asReal64(pi)) returns 24 45 68 84 251 33 9 64
` `o_bytes(asUint8(5)) returns 5
` `o_bytes(asint16(5)) returns 5 0`

### Notes

This function is likely only useful in rare cases, but it was done largely as a challenge to see if it was feasible to accomplish without using loops.

### Reference

### Dependencies

### Supported On

VEE 7.0+, all platforms

### See Also

© 2015-2021. All Rights Reserved. Stan Bischof (stan@worldbadminton.com). Last updated 09 August 2021 18:20.