public interface

IDataProvider

com.pnfsoftware.jeb.core.input.IDataProvider

Class Overview

Definition of a bytes provider, whose key can be augmented by an integer id (version code).

Summary

Constants
int NOT_IMPLEMENTED
Public Methods
abstract int getDataBytes(String name, int id, byte[] buffer, int bufferOffset, int wantedSize)
Optional method.
abstract byte[] getDataBytes(String key, int id)
abstract long getDataSize(String key, int id)
abstract InputStream openDataStream(String name, int id)
Optional method.

Constants

public static final int NOT_IMPLEMENTED

Constant Value: -10 (0xfffffff6)

Public Methods

public abstract int getDataBytes (String name, int id, byte[] buffer, int bufferOffset, int wantedSize)

Optional method. The default implementation returns NOT_IMPLEMENTED.

Parameters
id optional entry id
buffer destination buffer
bufferOffset offset where the data should be written to in the buffer
wantedSize requested size to read
Returns
  • the actual read size (may be less than requested); a negative number on error

public abstract byte[] getDataBytes (String key, int id)

Parameters
key entry name
id optional entry id
Returns
  • the entire data for the entry (at most 2Gb)

public abstract long getDataSize (String key, int id)

Parameters
key entry name
id optional entry id
Returns
  • the size of the entry (may be more than 4Gb)

public abstract InputStream openDataStream (String name, int id)

Optional method. The default implementation returns null.

Parameters
id optional entry id
Returns
  • an input stream (the caller must close the stream when done)
Throws
IOException