Package com.luciad.io

Interface ILcdChunkLoader

All Superinterfaces:
AutoCloseable, Cloneable, ILcdCloneable, ILcdDisposable

public interface ILcdChunkLoader extends ILcdCloneable, ILcdDisposable
Loader for a chunk of data. A chunk is just a part of the entire data, the data in a byte range.

Implementations are expected to know the source from which the data is to be loaded.

Since:
2022.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Makes Object.clone() public.
    long
     
    int
    loadChunk(long aStart, byte[] aBuffer)
    Load the data chunk for the byte range [aStart, aStart + aBuffer.length) into aBuffer.

    Methods inherited from interface com.luciad.util.ILcdDisposable

    close, dispose
  • Method Details

    • getDataLength

      long getDataLength() throws IOException
      Returns:
      the length of the entire data, if known, or else -1
      Throws:
      IOException
    • loadChunk

      int loadChunk(long aStart, byte[] aBuffer) throws IOException
      Load the data chunk for the byte range [aStart, aStart + aBuffer.length) into aBuffer. If aStart is larger than or equal the data length, -1 is returned.
      Parameters:
      aStart - position of the first byte to be loaded
      aBuffer - the buffer in which to load the data
      Returns:
      the number of bytes loaded, or -1
      Throws:
      IndexOutOfBoundsException - if aStart < 0 || aEnd < aStart
      IOException - if the data could not be loaded
      See Also:
    • clone

      Description copied from interface: ILcdCloneable

      Makes Object.clone() public.

      When for example extending from java.lang.Object, it can be implemented like this:
      
       public Object clone() {
         try {
           return super.clone();
         } catch ( CloneNotSupportedException e ) {
           // Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
           throw new RuntimeException( e );
         }
       }
       
      Specified by:
      clone in interface ILcdCloneable
      See Also: