com.pnfsoftware.jeb.core.output.text.IBinaryRepresentation |
The binary representation of a text document. (Do not confuse this with the encoding of the document buffer using a given charset.)
Note that offsets used by the method of this interface should be treated as unsigned; -1L is a
special non-addressable offset indicating an error. Therefore, the addressable range for binary
representations is [0, 2^64-2]
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract long |
convertCoordinatesToOffset(ICoordinates coord)
Perform a best-effort conversion of text document coordinates into an offset, as used by
read() and find() . | ||||||||||
abstract ICoordinates |
convertOffsetToCoordinates(long offset)
Perform a best-effort conversion of an offset, as used by
read() and find() ,
into an actual text document coordinates. | ||||||||||
abstract long | find(long offset, long lastOffset, byte[] pattern, byte[] patternMask) | ||||||||||
abstract long |
getBaseOffsetHint()
Get the optional hint indicating the ideal start offset of the binary representation.
| ||||||||||
abstract int |
read(long offset, int size, byte[] dst, int dstOffset)
Read bytes from the binary representation.
|
Perform a best-effort conversion of text document coordinates into an offset, as used by
read()
and find()
.
Perform a best-effort conversion of an offset, as used by read()
and find()
,
into an actual text document coordinates.
offset | offset to start the search from |
---|---|
lastOffset | offset to end the search at; it may be less than the start offset, in which case, a reverse search will be performed |
pattern | binary pattern |
patternMask | optional binary mask (if present, must have the same length as the pattern) |
Get the optional hint indicating the ideal start offset of the binary representation. Reading before this offset is likely to fail.
Read bytes from the binary representation.
offset | offset to read at |
---|---|
size | maximum number of bytes to read |
dst | destination array |
dstOffset | offset to write the bytes at in the destination array |