public virtual void writeJP2HeaderBox()
{
// Write box length (LBox)
// if the number of bits per components varies, a bpcc box is written
if (bpcVaries)
fi.writeInt(8 + IHB_LENGTH + CSB_LENGTH + BPC_LENGTH + nc);
else
fi.writeInt(8 + IHB_LENGTH + CSB_LENGTH);
// Write a JP2Header (TBox)
fi.writeInt(CSJ2K.j2k.fileformat.FileFormatBoxes.JP2_HEADER_BOX);
// Write image header box
writeImageHeaderBox();
// Write Colour Bpecification Box
writeColourSpecificationBox();
// if the number of bits per components varies write bpcc box
if (bpcVaries)
writeBitsPerComponentBox();
}