private void HandlePageAssociation(SegmentHeader segmentHeader) { int pageAssociation; bool isPageAssociationSizeSet = segmentHeader.IsPageAssociationSizeSet(); if (isPageAssociationSizeSet) { // field is 4 bytes long short[] buf = new short[4]; reader.Readbyte(buf); pageAssociation = BinaryOperation.GetInt32(buf); } else { // field is 1 byte long pageAssociation = reader.Readbyte(); } segmentHeader.SetPageAssociation(pageAssociation); if (JBIG2StreamDecoder.debug) { Console.WriteLine("pageAssociation = " + pageAssociation); } }