Package com.luciad.io
Interface ILcdChunkLoader
- All Superinterfaces:
AutoCloseable
,Cloneable
,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
Methods inherited from interface com.luciad.util.ILcdDisposable
close, dispose
-
Method Details
-
getDataLength
- Returns:
- the length of the entire data, if known, or else -1
- Throws:
IOException
-
loadChunk
Load the data chunk for the byte range[aStart, aStart + aBuffer.length)
intoaBuffer
. IfaStart
is larger than or equal the data length,-1
is returned.- Parameters:
aStart
- position of the first byte to be loadedaBuffer
- the buffer in which to load the data- Returns:
- the number of bytes loaded, or
-1
- Throws:
IndexOutOfBoundsException
- ifaStart < 0 || aEnd < aStart
IOException
- if the data could not be loaded- See Also:
-
clone
ILcdChunkLoader clone()Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.clone()
public.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 interfaceILcdCloneable
- See Also:
-