Class HexDumpDocument
- All Implemented Interfaces:
IGenericDocument,ITextDocument,IEventSource
Example:
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.
-
Field Summary
Fields inherited from class com.pnfsoftware.jeb.util.events.EventSource
onEventCallCount -
Constructor Summary
ConstructorsConstructorDescriptionHexDumpDocument(IInput input) HexDumpDocument(IInput input, IUnit unit) Create a new hexdump document to represent the input binary data. -
Method Summary
Modifier and TypeMethodDescriptionaddressToCoordinates(String address, CoordinatesConversionPrecision precision) Precision is not used - Use an exact addresscoordinatesToAddress(ICoordinates coordinates, AddressConversionPrecision precision) Convert document-specific text coordinates to a unit-specific address.voiddispose()The default implementation does nothing.longGet the range of anchor points in the document.getDocumentPart(long anchorId, int linesAfter, int linesBefore) Retrieve a document part.getInput()Retrieve the input data.Methods inherited from class com.pnfsoftware.jeb.core.output.text.impl.AbstractTextDocument
addressToCoordinates, coordinatesToAddress, format, getDocumentPart, getDocumentPart2, getFirstAnchor, getInitialAnchor, getPropertyManager, toString, useDisplayLineNumber, useLineDeltaMethods inherited from class com.pnfsoftware.jeb.util.events.EventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, notifyListeners, notifyListeners, relay, removeListener, setParentSourceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSourceMethods inherited from interface com.pnfsoftware.jeb.core.output.IGenericDocument
getUnitMethods inherited from interface com.pnfsoftware.jeb.core.output.text.ITextDocument
getBinaryRepresentation, hasBinaryRepresentation
-
Constructor Details
-
HexDumpDocument
Create a new hexdump document to represent the input binary data.- Parameters:
input- mandatory input dataunit- optional underlying input for extra addressing methods
-
HexDumpDocument
-
-
Method Details
-
dispose
public void dispose()Description copied from class:AbstractTextDocumentThe default implementation does nothing.- Specified by:
disposein interfaceIGenericDocument- Overrides:
disposein classAbstractTextDocument
-
getInput
Retrieve the input data.- Returns:
- the input data
-
getAnchorCount
public long getAnchorCount()Description copied from interface:ITextDocumentGet the range of anchor points in the document. Returning 1 means that the document returns a single part, holding the entire contents.Note that the anchor at "
ITextDocument.getFirstAnchor()+ITextDocument.getAnchorCount()" is the "end" anchor (one after the last), and lies outside the document. It is not a valid anchor.- Returns:
- the count/range of anchors in this document, must be greater than zero
-
getDocumentPart
Description copied from interface:ITextDocumentRetrieve a document part. Clients call this method to retrieve a document part starting at a specific anchor, and containing the given amount of lines after and before the anchor. It is the responsibility of the implementor to sanitize the input (eg, negative number of lines, invalid anchor, etc.) and provide appropriate response (eg, truncating). It is recommended that implementors try not to raise an exception on error. In the worst case scenario, an empty document can be returned.- Parameters:
anchorId- the anchor identifierlinesAfter- hint lines count to return after the given anchor, could be more or lesslinesBefore- hint lines count to return before the given anchor, could be more or less- Returns:
- a document part containing as many anchors as required to honor the client requests. If linesAfter is non-null, the first anchor within the document part may not be anchorId, but one anchor before that. THis method should return null if an invalid anchor was provided
-
coordinatesToAddress
Description copied from interface:ITextDocumentConvert 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.
- Specified by:
coordinatesToAddressin interfaceITextDocument- Overrides:
coordinatesToAddressin classAbstractTextDocument- Parameters:
coordinates- the coordinatesprecision- indicate the precision of the address (AddressConversionPrecision.COARSEwill return a raw address, with a faster result whileAddressConversionPrecision.FINEwill return a more precise address that can be a bit longer). IfAddressConversionPrecision.COARSEcan not be retrieved, it may return a null result, and the user will need to recall this method with another precision.- Returns:
- the address, null on error
-
addressToCoordinates
Description copied from class:AbstractTextDocumentPrecision is not used - Use an exact address- Specified by:
addressToCoordinatesin interfaceITextDocument- Overrides:
addressToCoordinatesin classAbstractTextDocument- Parameters:
address- a textual address- Returns:
- the text coordinates, null on error
-