public class

HexDumpDocument

extends AbstractTextDocument
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.events.EventSource
     ↳ com.pnfsoftware.jeb.core.output.text.impl.AbstractTextDocument
       ↳ com.pnfsoftware.jeb.core.output.text.impl.HexDumpDocument

Class Overview

A text document used to represent binary data as a standardized hex-dump text blob:

 00000000  05 4B 03 04 14 00 08 08 08 00 11 58 73 45 63 4A  .K.........XsEcJ
 00000010  95 6A 29 18 01 00 9D 62 03 00 14 00 00 00 4D 45  .j)....b......ME
 ...
 
Each line represents 16 bytes of data. The input contents can have up to 2^63 bytes. (Note that addresses in the left-most column will be encoded as 32-bit hex values for the contents has less than 2^31 bytes). The right-most column is an ASCII representation of the associated binary data; non ASCII characters are represented as dots.

Important: the default addressing scheme used by this document is unlikely to be consistent with other units'. Addresses start with the reserved '@' prefix, and are in the form @????h, where XXX represent an hexadecimal offset within the input. Implementors are free to override this scheme if they wish to make it consistent with addressing used in other documents produced by a same unit. This note is relevant only if the document is produced by a unit.

Note: this document is not serializable; it should not be used in a list of persisted presentations.

Summary

Public Constructors
HexDumpDocument(IInput input)
Create a new hexdump document to represent the input binary data.
Public Methods
ICoordinates addressToCoordinates(String address)
Convert a unit-specific address to document-specific text coordinates.
String coordinatesToAddress(ICoordinates coordinates)
Convert document-specific text coordinates to a unit-specific address.
void dispose()
Dispose of resources and handles used by this document.
long getAnchorCount()
ITextDocumentPart getDocumentPart(long anchorId, int linesAfter, int linesBefore)
IInput getInput()
Retrieve the input data.
[Expand]
Inherited Methods
From class com.pnfsoftware.jeb.core.output.text.impl.AbstractTextDocument
From class com.pnfsoftware.jeb.util.events.EventSource
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.output.IGenericDocument
From interface com.pnfsoftware.jeb.core.output.text.ITextDocument
From interface com.pnfsoftware.jeb.util.events.IEventSource

Public Constructors

public HexDumpDocument (IInput input)

Create a new hexdump document to represent the input binary data.

Parameters
input manadatory input data

Public Methods

public ICoordinates addressToCoordinates (String address)

Convert a unit-specific address to document-specific text coordinates. It is recommended to return canonical coordinates. The implementation might return approximate coordinates, ie the closest coordinates (in terms of distance) calculated as part of a best effort approach to minimizing the return of null values.

Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.

Parameters
address a textual address
Returns
  • the text coordinates, null on error

public String coordinatesToAddress (ICoordinates coordinates)

Convert document-specific text coordinates to a unit-specific address.

Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.

Parameters
coordinates the coordinates
Returns
  • the address, null on error

public void dispose ()

Dispose of resources and handles used by this document. The object creator should call this method upon destruction.

public long getAnchorCount ()

public ITextDocumentPart getDocumentPart (long anchorId, int linesAfter, int linesBefore)

public IInput getInput ()

Retrieve the input data.

Returns
  • the input data