case TiffDataFormat.CODE_STRING:
handler.setString(tagId, reader.getNullTerminatedString(tagValueOffset, componentCount));
break;
case TiffDataFormat.CODE_RATIONAL_S:
if (componentCount == 1) {
handler.setRational(tagId, new Rational(reader.getInt32(tagValueOffset), reader.getInt32(tagValueOffset + 4)));
} else if (componentCount > 1) {
Rational[] array = new Rational[componentCount];
for (int i = 0; i < componentCount; i++)
array[i] = new Rational(reader.getInt32(tagValueOffset + (8 * i)), reader.getInt32(tagValueOffset + 4 + (8 * i)));
handler.setRationalArray(tagId, array);
}
break;
case TiffDataFormat.CODE_RATIONAL_U:
if (componentCount == 1) {
handler.setRational(tagId, new Rational(reader.getUInt32(tagValueOffset), reader.getUInt32(tagValueOffset + 4)));
} else if (componentCount > 1) {
Rational[] array = new Rational[componentCount];
for (int i = 0; i < componentCount; i++)
array[i] = new Rational(reader.getUInt32(tagValueOffset + (8 * i)), reader.getUInt32(tagValueOffset + 4 + (8 * i)));
handler.setRationalArray(tagId, array);
}
break;
case TiffDataFormat.CODE_SINGLE:
if (componentCount == 1) {