print.rawBlock: Print Method for Block of Binary Data

Description Usage Arguments Details Author(s) See Also Examples

View source: R/rawBlock.R

Description

This function displays a "rawBlock" object. Each line of output contains a binary offset, the binary data in a raw machine format, and an interpretation of the data in a human-readable format. The object contains parameters controlling the format of the display, some of which may be overridden in the call to print.

Usage

1
2
3
4
5
## S3 method for class 'rawBlock'
print(x, width = NULL, machine = NULL,
      sep1 = "  :  ", sep2 = "  |  ",
      showOffset = TRUE, showHuman = TRUE, 
      page = FALSE, ...)

Arguments

x

A "rawBlock" object.

width

The number of bytes to display per line of output.

machine

The machine format to display; either "hex" or "binary".

sep1

A separator to insert between the block offset and the machine format.

sep2

A separator to insert between the machine format and the human-readable format.

showOffset

If FALSE, the column of offsets is not printed.

showHuman

If FALSE, the column of human-readable format is not printed.

page

If TRUE the output is sent to the file viewer specified by getOption("pager").

...

Other arguments to print.

Details

If either width or machine is NULL, the relevant value is taken from the "rawBlock" object. The human-readable format is taken from the "rawBlock" object.

Author(s)

Paul Murrell

See Also

readRaw as.character.rawBlock

Examples

1
2
3
4
fileBlock <- readRaw(hexViewFile("rawTest.txt"))
print(fileBlock)
print(fileBlock, width=8)
print(fileBlock, machine="binary", width=4)

Example output

0  :  74 65 73 74 20 70 61 74 74 65 72 6e 0a              |  test pattern.     
0  :  74 65 73 74 20 70 61 74  |  test pat
8  :  74 65 72 6e 0a           |  tern.    
 0  :  01110100 01100101 01110011 01110100  |  test
 4  :  00100000 01110000 01100001 01110100  |   pat
 8  :  01110100 01100101 01110010 01101110  |  tern
12  :  00001010                             |  .    

hexView documentation built on May 2, 2019, 7:02 a.m.