Package com.pnfsoftware.jeb.core.input
Interface IDataProvider
Provider of named binary entries, optionally qualified by an integer identifier.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intReturn value used by optional methods that are not implemented. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getDataBytes(String key, int id) default intgetDataBytes(String name, int id, byte[] buffer, int bufferOffset, int wantedSize) Optional method allowing callers to retrieve a subset of an entry without materializing it entirely.longgetDataSize(String key, int id) default InputStreamopenDataStream(String name, int id) Optional method.
-
Field Details
-
NOT_IMPLEMENTED
static final int NOT_IMPLEMENTEDReturn value used by optional methods that are not implemented.- See Also:
-
-
Method Details
-
getDataSize
- Parameters:
key- entry nameid- optional entry id- Returns:
- the size of the entry (may be more than 4Gb), or a negative value if unavailable
-
getDataBytes
- Parameters:
key- entry nameid- optional entry id- Returns:
- the entire entry data, or
nullif unavailable; implementations are expected to return at most 2Gb
-
getDataBytes
Optional method allowing callers to retrieve a subset of an entry without materializing it entirely. The default implementation returnsNOT_IMPLEMENTED.- Parameters:
name- entry nameid- optional entry idbuffer- destination bufferbufferOffset- offset where the data should be written to in the bufferwantedSize- requested size to read- Returns:
- the actual read size (may be less than requested); a negative number on error
-
openDataStream
Optional method. The default implementation returns null.- Parameters:
name- entry nameid- optional entry id- Returns:
- an input stream for the entry, or
nullif this access mode is unsupported; the caller must close the stream - Throws:
IOException- on I/O error
-