# Raw vector with 16 bytes (128 bits) of dummy data
data <- as.raw(1:16)
con <- rawConnection(data, 'rb')
read_f64(con, n = 1) # Read a 64-bit double-precision number
read_f16(con, n = 4) # Read 4 x 16-bit half-precision number
close(con)
Run the code above in your browser using DataLab