Interface IDataProvider


@Ser public interface IDataProvider
Definition of a bytes provider, whose key can be augmented by an integer id (version code).
  • Field Details

  • Method Details

    • getDataSize

      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)
    • getDataBytes

      byte[] getDataBytes(String key, int id)
      Parameters:
      key - entry name
      id - optional entry id
      Returns:
      the entire data for the entry (at most 2Gb)
    • getDataBytes

      default int getDataBytes(String name, int id, byte[] buffer, int bufferOffset, int wantedSize)
      Optional method. The default implementation returns NOT_IMPLEMENTED.
      Parameters:
      key - entry name
      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
    • openDataStream

      default InputStream openDataStream(String name, int id) throws IOException
      Optional method. The default implementation returns null.
      Parameters:
      key - entry name
      id - optional entry id
      Returns:
      an input stream (the caller must close the stream when done)
      Throws:
      IOException