BinaryWriter | R Documentation |
Create a new instance of the BinaryWriter class for writing bulk binary data.
BinaryWriter(
output,
byte_offset,
data_type,
bytes_per_element,
endian = .Platform$endian
)
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) |
An object of class BinaryWriter
BinaryReader
for reading binary data
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.