Closes the underlying connection associated with a BinaryReader or BinaryWriter object. This should be called when you're done with the reader/writer to free system resources.
Examples
# \donttest{
# Create a temporary file and write some data
tmp <- tempfile()
writer <- BinaryWriter(tmp, byte_offset = 0L,
data_type = "DOUBLE", bytes_per_element = 8L)
write_elements(writer, rnorm(100))
close(writer)
# Read the data back
reader <- BinaryReader(tmp, byte_offset = 0L,
data_type = "DOUBLE", bytes_per_element = 8L)
data <- read_elements(reader, 100)
#> Warning: incomplete string at end of file has been discarded
close(reader)
# Clean up
unlink(tmp)
# }