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

blockValue

Extract the Value of a Binary Block


Description

The blockValue function returns the interpreted value of a block of binary data (a "rawBlock" object).

The blockString function returns a null-terminated string from a block of binary data that is interpreted as a character data.

Usage

blockValue(block)

blockString(block)

Arguments

block

A "rawBlock" object.

Details

The type of the value returned is determined when the binary block is created (e.g., by readRaw) not when the value is extracted by the blockValue function.

The blockString function is useful for extracting a value from a binary block which is a string padded with null characters.

The blockString function throws an error if the block is not interpreted as a character value.

Value

Either a character, or numeric vector depending on how the binary block should be interpreted.

Author(s)

Paul Murrell

See Also

Examples

charBlock <- readRaw(hexViewFile("rawTest.txt"), width=8)
blockValue(charBlock)
blockString(charBlock)

intBlock <- readRaw(hexViewFile("rawTest.int"), human="int")
blockValue(intBlock)

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.