| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder
edu.harvard.hul.ois.jhove.module.jpeg2000.JP2Box
public abstract class JP2Box
Superclass for JPEG 2000 boxes.
| Field Summary | |
|---|---|
| protected  long | _bytesRead | 
| protected  java.util.List<Property> | associations | 
| protected static java.lang.String | DESCRIPTION_NAME | 
| protected static java.lang.String | noJP2Hdr | 
| protected  long | startBytesRead | 
| Fields inherited from class edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder | 
|---|
| _boxHeader, _dstrm, _module, _parentBox, _raf, _repInfo, bytesLeft, filePos, hasBoxes | 
| Constructor Summary | |
|---|---|
| JP2Box(java.io.RandomAccessFile raf)Constructor. | |
| JP2Box(java.io.RandomAccessFile raf,
       BoxHolder parent)Constructor for a box which is found within a superbox. | |
| Method Summary | |
|---|---|
| protected  void | addAssociation(Property p) | 
| static JP2Box | boxMaker(java.lang.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  java.lang.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(java.io.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(java.io.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. | 
| Methods inherited from class edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder | 
|---|
| getFilePos, hasNext, next, remove, superboxOverrun, superboxUnderrun | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected long startBytesRead
protected long _bytesRead
protected java.util.List<Property> associations
protected static final java.lang.String noJP2Hdr
protected static final java.lang.String DESCRIPTION_NAME
| Constructor Detail | 
|---|
public JP2Box(java.io.RandomAccessFile raf)
public JP2Box(java.io.RandomAccessFile raf,
              BoxHolder parent)
parent - parent superbox of this box| Method Detail | 
|---|
protected void init(BoxHolder parent)
public void setModule(Jpeg2000Module module)
public void setBoxHeader(BoxHeader hdr)
public void setRepInfo(RepInfo info)
public void setDataInputStream(java.io.DataInputStream dstrm)
public void setRandomAccessFile(java.io.RandomAccessFile raf)
public static JP2Box boxMaker(java.lang.String hType,
                              BoxHolder parent)
hType - 4-character string indicating the box typeparent - parent BoxHolderprotected void initBytesRead()
protected void finalizeBytesRead()
public abstract boolean readBox()
                         throws java.io.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.
java.io.IOExceptionpublic int getBytesRead()
public void skipBox()
             throws java.io.IOException
java.io.IOExceptionprotected 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 java.lang.String getSelfPropName()
getSelfPropName in class BoxHolderprotected Property getSelfPropDesc()
null or a property
  with DESCRIPTION_NAME for its name.
protected long getLength()
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||