BinaryWriter {neuroim2} | R Documentation |
Create Binary Writer Object
Description
Create a new instance of the BinaryWriter class for writing bulk binary data.
Usage
BinaryWriter(
output,
byte_offset,
data_type,
bytes_per_element,
endian = .Platform$endian
)
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
tmp <- tempfile()
# Write to existing connection with offset
con <- file(tmp, "wb")
writer <- BinaryWriter(con, byte_offset = 100L,
data_type = "integer", bytes_per_element = 4L)
unlink(tmp)
[Package neuroim2 version 0.8.1 Index]