Create a new instance of the BinaryWriter class for writing bulk binary data.
Arguments
- output
Character string (file name) or connection object to write to
- byte_offset
Integer specifying bytes to skip at start of output
- data_type
Character string specifying R data type ('integer', 'double', etc.)
- bytes_per_element
Integer specifying bytes per data element (e.g., 4 or 8)
- endian
Character string specifying endianness ('big' or 'little', default: platform-specific)
Value
An object of class BinaryWriter
See also
BinaryReader
for reading binary data
Examples
if (FALSE) { # \dontrun{
# Create writer for double-precision data
writer <- BinaryWriter("output.bin", byte_offset = 0L,
data_type = "double", bytes_per_element = 8L)
# Write to existing connection with offset
con <- file("output.bin", "wb")
writer <- BinaryWriter(con, byte_offset = 100L,
data_type = "integer", bytes_per_element = 4L)
} # }