public byte[] GetGlobal(bool for_embedding) {
MemoryStream os = new MemoryStream();
try {
foreach (JBIG2Segment s in globals.Keys) {
if ( for_embedding &&
( s.type == END_OF_FILE || s.type == END_OF_PAGE ) ) {
continue;
}
os.Write(s.headerData, 0, s.headerData.Length);
os.Write(s.data, 0, s.data.Length);
}
os.Close();
} catch {
}
if ( os.Length <= 0 ) {
return null;
}
return os.ToArray();
}