private void writeCOM()
{
// JJ2000 COM marker segment
if (enJJ2KMarkSeg)
{
System.String str = "Created by: CSJ2K version " + JJ2KInfo.version;
int markSegLen; // the marker segment length
// COM marker
hbuf.Write((System.Int16) CSJ2K.j2k.codestream.Markers.COM);
// Calculate length: Lcom(2) + Rcom (2) + string's length;
markSegLen = 2 + 2 + str.Length;
hbuf.Write((System.Int16) markSegLen);
// Rcom
hbuf.Write((System.Int16) 1); // General use (IS 8859-15:1999(Latin) values)
byte[] chars = System.Text.Encoding.UTF8.GetBytes(str);
for (int i = 0; i < chars.Length; i++)
{
hbuf.Write((byte) chars[i]);
}
}
// other COM marker segments
if (otherCOMMarkSeg != null)
{
SupportClass.Tokenizer stk = new SupportClass.Tokenizer(otherCOMMarkSeg, "#");
while (stk.HasMoreTokens())
{
System.String str = stk.NextToken();
int markSegLen; // the marker segment length
// COM marker
hbuf.Write((System.Int16) CSJ2K.j2k.codestream.Markers.COM);
// Calculate length: Lcom(2) + Rcom (2) + string's length;
markSegLen = 2 + 2 + str.Length;
hbuf.Write((System.Int16) markSegLen);
// Rcom
hbuf.Write((System.Int16) 1); // General use (IS 8859-15:1999(Latin)
// values)
byte[] chars = System.Text.Encoding.UTF8.GetBytes(str);
for (int i = 0; i < chars.Length; i++)
{
hbuf.Write((byte) chars[i]);
}
}
}
}