Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

atomicBlock

Create an atomicBlock Object


Description

This function creates an "atomicBlock" object, which is a description of a block of binary data. This can be used as part of a description of a binary format.

Usage

atomicBlock(type = "char", width = NULL, machine = "hex",
            size = switch(type, char = 1, int = 4, real = 8),
            endian = "little", signed = TRUE)

Arguments

type

How the block of binary data will be interpreted. either "char" (an ASCII character), "int" (an integer), or "real" (a floating point number).

width

The number of bytes to print per row when displaying the block.

machine

How to print each byte when displaying; either "hex" or "binary".

size

The number of bytes used to generate each value when interpreting the raw binary as character or numeric data.

endian

The endianness of the binary data; used when interpreting bytes as numeric values.

signed

Whether the bytes should be interpreted as a signed numeric value.

Details

An "atomicBlock" object describes a binary block representing a single value.

Several standard binary types are predefined (with common C type equivalents in brackets): ASCIIchar (char), integer1 (signed char), integer2 (short), integer3, integer4 (int, long), integer8 (long long), real4 (float), real8 (double).

Value

An "atomicBlock" object.

Author(s)

Paul Murrell

See Also

Examples

# A C long
atomicBlock("int", size=4)
integer4

hexView

Viewing Binary Files

v0.3-4
GPL-2
Authors
Paul Murrell [aut, cre], Chao Bian [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.