public int read(byte[] data,
int off,
int len) throws IOException {
if (currentOffset < tiffheader.length)
{
int length = java.lang.Math.min(tiffheader.length - currentOffset, len);
if (length > 0)
{
System.arraycopy(tiffheader, currentOffset, data, off, length);
}
currentOffset += length;
return length;
}
else
{
return datastream.read(data,off,len);
}
}
For read methods only return as many bytes as we have left in the header
if we've exhausted the header, pass through to the InputStream of the raw CCITT data.
{@inheritDoc} |