JP2 Header File.
I am trying to parse the header file of a JP2 image, but I am having problems once I get to the SIZ Marker.
Here is an example of what I am doing, I can get the SOC fine but it doesnt like the SIZ.
int marker = (stream.read() << 8) | stream.read();
//Checks to make sure there is a SOC
if (marker == 0xFF4F)
marker = stream.readShort();
if(marker == 0xff51)
int length = stream.readUnsignedShort();
byte  buf = new byte[length];
buf= (byte)((length>>8) & 0xFF);
buf= (byte)(length & 0xFF);
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
DataInputStream dis = new DataInputStream(bais);
int len2 = dis.readUnsignedShort();
// Read the capability of the codestream (Rsiz)
int cap = dis.readUnsignedShort();
Swidth = dis.readInt();
Sheight = dis.readInt();
I am not sure what my problem is. For stream right now I am using InputImageStream...should I be using some sort of RandomAcessIO?