if (FALSE) { # interactive()
# Open a connection and configure it so out-of-bounds values
# will cause a warning only.
con <- rawConnection(as.raw(1:8), "rb")
con <- set_bounds_check(con, bounds_check = "warn")
# This line attempts to read a value from the connection which
# is too large to store in a double precision floating point without
# loss of integer precision.
# Usually this would cause an error to be raised, but the 'bounds_check'
# option has been set to give a warning only.
read_uint64(con, n = 1, promote = "dbl")
close(con)
}
Run the code above in your browser using DataLab