public abstract class BaseJP2KBox extends DefaultMutableTreeNode implements JP2KBoxMetadata
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
Constructor and Description |
---|
BaseJP2KBox(int length,
int type,
byte[] data)
Constructs a
Box instance using the provided the box type
and the box content in byte array format. |
BaseJP2KBox(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. |
BaseJP2KBox(Node node)
Constructs a Box from an "unknown" Node.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
protected abstract byte[] |
compose()
Composes the content byte array from the data elements.
|
byte[] |
getContent()
Returns the box content in byte array.
|
long |
getExtraLength()
Returns the box extra length.
|
int |
getLength()
Returns the box length.
|
IIOMetadataNode |
getNativeNode()
Creates an
IIOMetadataNode from this box. |
protected IIOMetadataNode |
getNativeNodeForSimpleBox()
Creates an
IIOMetadataNode from this box. |
int |
getType()
Returns the box type.
|
protected abstract void |
parse(byte[] data)
Parses the data elements from the byte array.
|
protected void |
setDefaultAttributes(IIOMetadataNode node)
Sets the default attributes, "Length", "Type", and "ExtraLength", to the
provided
IIOMetadataNode . |
void |
setExtraLength(long extraLength)
Sets the box extra length length to the provided value.
|
void |
setLength(int length)
Sets the box length to the provided value.
|
void |
setType(int type) |
String |
toString() |
add, breadthFirstEnumeration, children, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
insert, remove, remove, removeFromParent, setParent, setUserObject
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
public BaseJP2KBox(int length, int type, byte[] data)
Box
instance using the provided the box type
and the box content in byte array format.length
- The provided box length.type
- The provided box type.data
- The provided box content in a byte array.IllegalArgumentException
- If the length of the content byte array is not length -
8.public BaseJP2KBox(int length, int type, long extraLength, byte[] data)
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.length
- The provided box length.type
- The provided box type.extraLength
- The provided box extra length.data
- The provided box content in a byte array.IllegalArgumentException
- If the length of the content byte array is not extra
length - 16.public BaseJP2KBox(Node node) throws IIOInvalidTreeException
IIOInvalidTreeException
protected IIOMetadataNode getNativeNodeForSimpleBox()
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.public byte[] getContent()
getContent
in interface JP2KBox
protected abstract void parse(byte[] data)
protected abstract byte[] compose()
public IIOMetadataNode getNativeNode()
IIOMetadataNode
from this box. The format of
this node is defined in the XML dtd and xsd for the JP2 image file.getNativeNode
in interface JP2KBoxMetadata
public long getExtraLength()
JP2KBox
getExtraLength
in interface JP2KBox
it.geosolutions.imageio.plugins.jp2k.box.JPEG2000SimpleBox#getExtraLength()
public int getLength()
JP2KBox
public int getType()
JP2KBox
protected void setDefaultAttributes(IIOMetadataNode node)
IIOMetadataNode
.public void setExtraLength(long extraLength)
public void setLength(int length)
public void setType(int type)
type
- public String toString()
toString
in class DefaultMutableTreeNode
public Object clone()
clone
in interface JP2KBox
clone
in class DefaultMutableTreeNode
Copyright © 2006–2016 GeoSolutions. All rights reserved.