BinaryReader | R Documentation |
Create a new instance of the BinaryReader class for reading bulk binary data.
BinaryReader(
input,
byte_offset,
data_type,
bytes_per_element,
endian = .Platform$endian,
signed = TRUE
)
input |
Character string (file name) or connection object to read from |
byte_offset |
Integer specifying bytes to skip at start of input |
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) |
signed |
Logical indicating if data type is signed (default: TRUE) |
An object of class BinaryReader
BinaryWriter
for writing binary data
## Not run:
# Create reader for double-precision data
reader <- BinaryReader("data.bin", byte_offset = 0L,
data_type = "double", bytes_per_element = 8L)
# Read from existing connection with offset
con <- file("data.bin", "rb")
reader <- BinaryReader(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.