public interface ILcdChunkLoader extends ILcdCloneable, ILcdDisposable
Implementations are expected to know the source from which the data is to be loaded.
ALcdChunkedInputStreamFactory
Modifier and Type | Method and Description |
---|---|
ILcdChunkLoader |
clone()
Makes
Object.clone() public. |
long |
getDataLength() |
int |
loadChunk(long aStart,
byte[] aBuffer)
Load the data chunk for the byte range
[aStart, aStart + aBuffer.length) into aBuffer . |
close, dispose
long getDataLength() throws IOException
IOException
int loadChunk(long aStart, byte[] aBuffer) throws IOException
[aStart, aStart + aBuffer.length)
into aBuffer
.
If aStart
is larger than or equal the data length, -1
is returned.aStart
- position of the first byte to be loadedaBuffer
- the buffer in which to load the data-1
IndexOutOfBoundsException
- if aStart < 0 || aEnd < aStart
IOException
- if the data could not be loadedgetDataLength()
ILcdChunkLoader clone()
ILcdCloneable
Makes Object.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 );
}
}
clone
in interface ILcdCloneable
Object.clone()