# Interface: 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]`

## Method: convertCoordinatesToOffset
- parameter: `coord`, type: `com.pnfsoftware.jeb.core.output.text.ICoordinates`
- return type: `long`

Description: Perform a best\-effort conversion of text document coordinates into an offset, as used by `read()` and `find()`.
parameter: coord: text coordinates
return: the mapped offset, or `-1` if no mapping is available

## Method: convertOffsetToCoordinates
- parameter: `offset`, type: `long`
- return type: `com.pnfsoftware.jeb.core.output.text.ICoordinates`

Description: Perform a best\-effort conversion of an offset, as used by `read()` and `find()`, into an actual text document coordinates.
parameter: offset: binary offset
return: corresponding text coordinates, or `null` if no mapping is available

## Method: find
- parameter: `offset`, type: `long`
- parameter: `lastOffset`, type: `long`
- parameter: `pattern`, type: `byte[]`
- parameter: `patternMask`, type: `byte[]`
- return type: `long`

Description: 
parameter: offset: offset to start the search from
parameter: lastOffset: offset to end the search at; it may be less than the start offset, in which            case, a reverse search will be performed
parameter: pattern: binary pattern
parameter: patternMask: optional binary mask \(if present, must have the same length as the            pattern\)
return: an offset, \-1 if not found

## Method: getBaseOffsetHint
- return type: `long`

Description: Get the optional hint indicating the ideal start offset of the binary representation. Reading before this offset is likely to fail.
return: the recommended first readable offset

## Method: read
- parameter: `offset`, type: `long`
- parameter: `size`, type: `int`
- parameter: `dst`, type: `byte[]`
- parameter: `dstOffset`, type: `int`
- return type: `int`

Description: Read bytes from the binary representation.
parameter: offset: offset to read at
parameter: size: maximum number of bytes to read
parameter: dst: destination array
parameter: dstOffset: offset to write the bytes at in the destination array
return: the actual number of bytes read

