public abstract class JP2Box extends BoxHolder
Type | Property and Description |
---|---|
protected Property |
makeAssoc
Make a Property from the association list.
|
protected Property |
selfDesc
Returns a Property which describes the Box, for use
by Association boxes and perhaps others.
|
Modifier and Type | Field and Description |
---|---|
protected long |
_bytesRead |
protected List<Property> |
associations |
protected static String |
DESCRIPTION_NAME |
protected static String |
noJP2Hdr |
protected long |
startBytesRead |
_boxHeader, _dstrm, _module, _parentBox, _raf, _repInfo, bytesLeft, filePos, hasBoxes
Constructor and Description |
---|
JP2Box(RandomAccessFile raf)
Constructor.
|
JP2Box(RandomAccessFile raf,
BoxHolder parent)
Constructor for a box which is found within a
superbox.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addAssociation(Property p) |
static JP2Box |
boxMaker(String hType,
BoxHolder parent)
Static factory method for generating an object of the
appropriate subclass of MarkerSegment, based on the
box type.
|
protected void |
emptyBox()
Utility error reporting function for a box which is
expected to have subboxes, but doesn't.
|
protected void |
finalizeBytesRead() |
int |
getBytesRead() |
protected long |
getLength()
Returns the length of the box, including header, based
on the information in the header.
|
protected Property |
getSelfPropDesc()
Returns a Property which describes the box.
|
protected String |
getSelfPropName()
Returns the name of the Box.
|
protected void |
init(BoxHolder parent) |
protected void |
initBytesRead() |
protected Property |
makeAssocProperty()
Make a Property from the association list.
|
abstract boolean |
readBox()
Reads the box, putting appropriate information in
the RepInfo object.
|
protected Property |
selfDescProperty()
Returns a Property which describes the Box, for use
by Association boxes and perhaps others.
|
void |
setBoxHeader(BoxHeader hdr)
Sets the BoxHeader from which this Box was obtained.
|
void |
setDataInputStream(DataInputStream dstrm)
Assigns the DataInputStream from which the box is
being read.
|
void |
setModule(Jpeg2000Module module)
Sets the module under which the Box is being read.
|
void |
setRandomAccessFile(RandomAccessFile raf)
Assigns the RandomAccessFile from which the box is
being read.
|
void |
setRepInfo(RepInfo info)
Assigns a RepInfo object, so that subclasses of
JP2Box can add Properties and Messages.
|
void |
skipBox()
Skips over the box.
|
protected void |
wrongBoxContext()
Utility error reporting function for box in a context
(superbox or lack thereof) which is not permitted.
|
protected void |
wrongBoxSize()
Utility error reporting function for incorrect box length.
|
getFilePos, hasNext, next, remove, superboxOverrun, superboxUnderrun
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
protected Property makeAssocProperty
protected Property selfDescProperty
getSelfPropName
and
getSelfPropDesc
. A subclass
that shouldn't be added to the Association box's
property can override this to return null
.protected long startBytesRead
protected long _bytesRead
protected static final String noJP2Hdr
protected static final String DESCRIPTION_NAME
public JP2Box(RandomAccessFile raf)
public JP2Box(RandomAccessFile raf, BoxHolder parent)
parent
- parent superbox of this boxprotected void init(BoxHolder parent)
public void setModule(Jpeg2000Module module)
public void setBoxHeader(BoxHeader hdr)
public void setRepInfo(RepInfo info)
public void setDataInputStream(DataInputStream dstrm)
public void setRandomAccessFile(RandomAccessFile raf)
public static JP2Box boxMaker(String hType, BoxHolder parent)
hType
- 4-character string indicating the box typeparent
- parent BoxHolderprotected void initBytesRead()
protected void finalizeBytesRead()
public abstract boolean readBox() throws IOException
readBox
is called.
Thus, the header of the box must already have been read.
readBox
must completely consume the
box, so that the next byte to be read by the
DataInputStream is the FF
byte of the next Box.
The number of bytes read must be placed in _bytesRead.IOException
public int getBytesRead()
public void skipBox() throws IOException
IOException
protected void addAssociation(Property p)
protected void wrongBoxSize()
false
.protected void wrongBoxContext()
false
.protected void emptyBox()
protected Property makeAssocProperty()
protected Property selfDescProperty()
getSelfPropName
and
getSelfPropDesc
. A subclass
that shouldn't be added to the Association box's
property can override this to return null
.protected String getSelfPropName()
getSelfPropName
in class BoxHolder
protected Property getSelfPropDesc()
null
or a property
with DESCRIPTION_NAME
for its name.protected long getLength()
Copyright © 2008–2017 The Open Preservation Foundation. All rights reserved.