CADI.Common.LogicalTarget.JPEG2000.File
Class ReadJPEG2KFileFormat

java.lang.Object
  extended by CADI.Common.LogicalTarget.JPEG2000.File.ReadJPEG2KFileFormat

public class ReadJPEG2KFileFormat
extends java.lang.Object

This class is only used to read which is the JPEG2000 file format (jpc, jp2, jpx, or jpk).

Version:
1.0 2008/10/07
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
private  int fileFormat
          Definition in JP2LogicalTarget.fileFormatType
private  BufferedDataInputStream in
          Is an object with the input stream where the main header is read from.
 
Constructor Summary
ReadJPEG2KFileFormat(BufferedDataInputStream in)
          Constructor.
 
Method Summary
 int getFileFormat()
          Returns the fileFormat attribute.
private  void readFileTypeBox(long length)
          Reads the File Type Box and checks its conformity.
private  boolean readSignatureBox()
          Reads the Signature Box and checks its conformity.
 int run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

private BufferedDataInputStream in
Is an object with the input stream where the main header is read from.


fileFormat

private int fileFormat
Definition in JP2LogicalTarget.fileFormatType

Constructor Detail

ReadJPEG2KFileFormat

public ReadJPEG2KFileFormat(BufferedDataInputStream in)
Constructor.

Parameters:
in - input stream where data will be read from.
Method Detail

run

public int run()
        throws java.io.EOFException,
               ErrorException,
               java.io.IOException
Returns:
the fileFormat attribute.
Throws:
java.io.IOException
ErrorException
java.io.EOFException

getFileFormat

public int getFileFormat()
Returns the fileFormat attribute.

Returns:
the fileFormat attribute.

readSignatureBox

private boolean readSignatureBox()
                          throws ErrorException,
                                 java.io.EOFException,
                                 java.io.IOException
Reads the Signature Box and checks its conformity.

Throws:
ErrorException - when the header information is ambiguous or incorrect
java.io.EOFException
java.io.IOException

readFileTypeBox

private void readFileTypeBox(long length)
                      throws ErrorException,
                             java.io.EOFException,
                             java.io.IOException
Reads the File Type Box and checks its conformity.

Parameters:
length -
Throws:
ErrorException - when the header information is ambiguous or incorrect
java.io.EOFException
java.io.IOException


CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Group on Interactive Coding of Images (GICI) (contact)