1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.imaging.formats.tiff.taginfos;
18
19 import java.nio.ByteOrder;
20
21 import org.apache.commons.imaging.common.ByteConversions;
22 import org.apache.commons.imaging.common.RationalNumber;
23 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
24 import org.apache.commons.imaging.formats.tiff.fieldtypes.AbstractFieldType;
25
26 public class TagInfoSRationals extends TagInfo {
27 public TagInfoSRationals(final String name, final int tag, final int length, final TiffDirectoryType directoryType) {
28 super(name, tag, AbstractFieldType.SRATIONAL, length, directoryType);
29 }
30
31 public byte[] encodeValue(final ByteOrder byteOrder, final RationalNumber... values) {
32 return ByteConversions.toBytes(values, byteOrder);
33 }
34
35 public RationalNumber[] getValue(final ByteOrder byteOrder, final byte[] bytes) {
36 return ByteConversions.toRationals(bytes, byteOrder, false);
37 }
38 }