| java.lang.Object com.sun.media.imageioimpl.plugins.jpeg2000.Box
All known Subclasses: com.sun.media.imageioimpl.plugins.jpeg2000.ChannelDefinitionBox, com.sun.media.imageioimpl.plugins.jpeg2000.ComponentMappingBox, com.sun.media.imageioimpl.plugins.jpeg2000.PaletteBox, com.sun.media.imageioimpl.plugins.jpeg2000.FileTypeBox, com.sun.media.imageioimpl.plugins.jpeg2000.DataEntryURLBox, com.sun.media.imageioimpl.plugins.jpeg2000.HeaderBox, com.sun.media.imageioimpl.plugins.jpeg2000.ResolutionBox, com.sun.media.imageioimpl.plugins.jpeg2000.XMLBox, com.sun.media.imageioimpl.plugins.jpeg2000.ColorSpecificationBox, com.sun.media.imageioimpl.plugins.jpeg2000.BitsPerComponentBox, com.sun.media.imageioimpl.plugins.jpeg2000.SignatureBox, com.sun.media.imageioimpl.plugins.jpeg2000.UUIDListBox, com.sun.media.imageioimpl.plugins.jpeg2000.UUIDBox,
Box | public class Box (Code) | | This class is defined to create the box of JP2 file format. A box has
a length, a type, an optional extra length and its content. The subclasses
should explain the content information.
|
Constructor Summary | |
public | Box(int length, int type, byte[] data) Constructs a Box instance using the provided
the box type and the box content in byte array format. | public | Box(int length, int type, long extraLength, byte[] data) Constructs a Box instance using the provided
the box type, the box extra length, and the box content in byte
array format. | public | Box(ImageInputStream iis, int pos) Constructs a Box instance from the provided
ImageInputStream at the specified position. | public | Box(Node node) Constructs a Box from an "unknown" Node. |
data | protected byte[] data(Code) | | |
extraLength | protected long extraLength(Code) | | |
length | protected int length(Code) | | Box length, extra length, type and content data array
|
Box | public Box(int length, int type, byte[] data)(Code) | | Constructs a Box instance using the provided
the box type and the box content in byte array format.
Parameters: length - The provided box length. Parameters: type - The provided box type. Parameters: data - The provided box content in a byte array. throws: IllegalArgumentException - If the length of the content byte arrayis not length - 8. |
Box | public Box(int length, int type, long extraLength, byte[] data)(Code) | | Constructs a Box instance using the provided
the box type, the box extra length, and the box content in byte
array format. In this case, the length of the box is set to 1,
which indicates the extra length is meaningful.
Parameters: length - The provided box length. Parameters: type - The provided box type. Parameters: extraLength - The provided box extra length. Parameters: data - The provided box content in a byte array. throws: IllegalArgumentException - If the length of the content byte arrayis not extra length - 16. |
Box | public Box(ImageInputStream iis, int pos) throws IOException(Code) | | Constructs a Box instance from the provided
ImageInputStream at the specified position.
Parameters: iis - The ImageInputStream contains the box. Parameters: pos - The position from where to read the box. throws: IOException - If any IOException is thrown in the called readmethods. |
Box | public Box(Node node) throws IIOInvalidTreeException(Code) | | Constructs a Box from an "unknown" Node. This node has at
least the attribute "Type", and may have the attribute "Length",
"ExtraLength" and a child "Content". The child node content is a
IIOMetaDataNode with a byte[] user object.
|
compose | protected void compose()(Code) | | Composes the content byte array from the data elements.
|
copyInt | public static void copyInt(byte[] data, int pos, int value)(Code) | | Copies that four bytes of an integer into the byte array. Necessary
for the subclasses to compose the content array from the data elements
|
createBox | public static Box createBox(int type, Node node) throws IIOInvalidTreeException(Code) | | Creates a Box object with the provided type
based on the provided Node object based on reflection.
|
getAttribute | public static Object getAttribute(Node node, String name)(Code) | | Extracts the value of the attribute from name.
|
getBoxClass | public static Class getBoxClass(int type)(Code) | | Returns the Box class for the box with the provided type .
|
getByteArrayElementValue | protected static byte[] getByteArrayElementValue(Node node)(Code) | | Gets the byte array from an IIOMetadataNode .
|
getByteElementValue | protected static byte getByteElementValue(Node node)(Code) | | Gets its byte value from an IIOMetadataNode .
|
getContent | public byte[] getContent()(Code) | | Returns the box content in byte array.
|
getExtraLength | public long getExtraLength()(Code) | | Returns the box extra length.
|
getIntArrayElementValue | protected static int[] getIntArrayElementValue(Node node)(Code) | | Gets the integer array from an IIOMetadataNode .
|
getIntElementValue | protected static int getIntElementValue(Node node)(Code) | | Gets its integer value from an IIOMetadataNode .
|
getLength | public int getLength()(Code) | | Returns the box length.
|
getName | public static String getName(int type)(Code) | | Returns the XML tag name defined in JP2 XML xsd/dtd for the box
with the provided type . If the type is
not known, the string "unknown" is returned.
|
getNativeNode | public IIOMetadataNode getNativeNode()(Code) | | Creates an IIOMetadataNode from this
box. The format of this node is defined in the XML dtd and xsd
for the JP2 image file.
|
getNativeNodeForSimpleBox | protected IIOMetadataNode getNativeNodeForSimpleBox()(Code) | | Creates an IIOMetadataNode from this
box. The format of this node is defined in the XML dtd and xsd
for the JP2 image file.
This method is designed for the types of boxes whose XML tree
only has 2 levels.
|
getShortElementValue | protected static short getShortElementValue(Node node)(Code) | | Gets its short value from an IIOMetadataNode .
|
getStringElementValue | protected static String getStringElementValue(Node node)(Code) | | Gets its String value from an IIOMetadataNode .
|
getType | public int getType()(Code) | | Returns the box type.
|
getTypeByName | public static String getTypeByName(String name)(Code) | | Returns the type String based on the provided name.
|
getTypeInt | public static int getTypeInt(String s)(Code) | | Converts the box type from integer to string. This is necessary because
type is defined as String in xsd/dtd and integer in the box classes.
|
getTypeString | public static String getTypeString(int type)(Code) | | Converts the box type from integer to string. This is necessary because
type is defined as String in xsd/dtd and integer in the box classes.
|
parse | protected void parse(byte[] data)(Code) | | Parses the data elements from the byte array. The subclasses should
override this method.
|
parseByteArray | public static byte[] parseByteArray(String value)(Code) | | Parses the byte array expressed by a string.
|
parseIntArray | protected static int[] parseIntArray(String value)(Code) | | Parses the integer array expressed a string.
|
setContent | public void setContent(byte[] data)(Code) | | Sets the box content. If the content length is not length -8 or
extra length - 16, IllegalArgumentException will be thrown.
|
setDefaultAttributes | protected void setDefaultAttributes(IIOMetadataNode node)(Code) | | Sets the default attributes, "Length", "Type", and "ExtraLength", to
the provided IIOMetadataNode .
|
setExtraLength | public void setExtraLength(long extraLength)(Code) | | Sets the box extra length length to the provided value.
|
setLength | public void setLength(int length)(Code) | | Sets the box length to the provided value.
|
|
|