doSyntaxrmSemantics(CodePoint.SYNERRCD_DSS_LENGTH_BYTE_NUMBER_MISMATCH); doSyntaxrmSemantics(CodePoint.SYNERRCD_DSS_CONT_LESS_OR_EQUAL_2);
doSyntaxrmSemantics(CodePoint.SYNERRCD_DSS_LENGTH_BYTE_NUMBER_MISMATCH); doSyntaxrmSemantics(CodePoint.SYNERRCD_DSS_CONT_LESS_OR_EQUAL_2);
doSyntaxrmSemantics(CodePoint.SYNERRCD_DSS_LESS_THAN_6); doSyntaxrmSemantics(CodePoint.SYNERRCD_CBYTE_NOT_D0); && ((gdsFormatter & 0x03) != 0x03) && ((gdsFormatter & 0x04) != 0x04)) { doSyntaxrmSemantics(CodePoint.SYNERRCD_FBYTE_NOT_SUPPORTED); doSyntaxrmSemantics(CodePoint.SYNERRCD_CHAIN_OFF_SAME_NEXT_CORRELATOR); doSyntaxrmSemantics(CodePoint.SYNERRCD_CHAIN_OFF_ERROR_CONTINUE); doSyntaxrmSemantics(CodePoint.SYNERRCD_INVALID_CORRELATOR); } else { dssCorrelationID_ = nextCorrelationID;
protected final void readDSSContinuationHeader() throws DisconnectException { ensureALayerDataInBuffer(2); dssLength_ = ((buffer_[pos_++] & 0xFF) << 8) + ((buffer_[pos_++] & 0xFF) << 0); if ((dssLength_ & 0x8000) == 0x8000) { dssLength_ = DssConstants.MAX_DSS_LEN; dssIsContinued_ = true; } else { dssIsContinued_ = false; } // it is a syntax error if the dss continuation header length // is less than or equal to two if (dssLength_ <= 2) { doSyntaxrmSemantics(CodePoint.SYNERRCD_DSS_CONT_LESS_OR_EQUAL_2); } dssLength_ -= 2; // avoid consuming the DSS cont header }
protected final void readDSSContinuationHeader() throws DisconnectException { ensureALayerDataInBuffer(2); dssLength_ = ((buffer_[pos_++] & 0xFF) << 8) + ((buffer_[pos_++] & 0xFF) << 0); if ((dssLength_ & 0x8000) == 0x8000) { dssLength_ = DssConstants.MAX_DSS_LEN; dssIsContinued_ = true; } else { dssIsContinued_ = false; } // it is a syntax error if the dss continuation header length // is less than or equal to two if (dssLength_ <= 2) { doSyntaxrmSemantics(CodePoint.SYNERRCD_DSS_CONT_LESS_OR_EQUAL_2); } dssLength_ -= 2; // avoid consuming the DSS cont header }
doSyntaxrmSemantics(CodePoint.SYNERRCD_DSS_LESS_THAN_6); doSyntaxrmSemantics(CodePoint.SYNERRCD_CBYTE_NOT_D0); && ((gdsFormatter & 0x03) != 0x03) && ((gdsFormatter & 0x04) != 0x04)) { doSyntaxrmSemantics(CodePoint.SYNERRCD_FBYTE_NOT_SUPPORTED); doSyntaxrmSemantics(CodePoint.SYNERRCD_CHAIN_OFF_SAME_NEXT_CORRELATOR); doSyntaxrmSemantics(CodePoint.SYNERRCD_CHAIN_OFF_ERROR_CONTINUE); doSyntaxrmSemantics(CodePoint.SYNERRCD_INVALID_CORRELATOR); } else { dssCorrelationID_ = nextCorrelationID;
private final void peekExtendedLength() throws DisconnectException { peekedNumOfExtendedLenBytes_ = (peekedLength_ - 0x8004); switch (peekedNumOfExtendedLenBytes_) { case 4: // L L C P Extended Length // -->2-bytes<-- --->4-bytes<--- // We are only peeking the length here, the actual pos_ is still before LLCP. We ensured // 4-bytes in peedCodePoint() for the LLCP, and we need to ensure 4-bytes(of LLCP) + the // extended length bytes here. if (longBufferForDecryption_ == null) //we ddon't need to do this if it's data stream encryption { ensureBLayerDataInBuffer(4 + 4); } // The ddmScalarLen_ we peek here does not include the LLCP and the extended length bytes // themselves. So we will add those back to the ddmScalarLen_ so it can be adjusted // correctly in parseLengthAndMatchCodePoint(). (since the adjustLengths() method will // subtract the length from ddmScalarLen_) peekedLength_ = ((buffer_[pos_ + 4] & 0xff) << 24) + ((buffer_[pos_ + 5] & 0xff) << 16) + ((buffer_[pos_ + 6] & 0xff) << 8) + ((buffer_[pos_ + 7] & 0xff) << 0); break; case 0: peekedLength_ = -1; // this ddm is streamed, so set -1 -> length unknown break; default: doSyntaxrmSemantics(CodePoint.SYNERRCD_INCORRECT_EXTENDED_LEN); } }
private final void peekExtendedLength() throws DisconnectException { peekedNumOfExtendedLenBytes_ = (peekedLength_ - 0x8004); switch (peekedNumOfExtendedLenBytes_) { case 4: // L L C P Extended Length // -->2-bytes<-- --->4-bytes<--- // We are only peeking the length here, the actual pos_ is still before LLCP. We ensured // 4-bytes in peedCodePoint() for the LLCP, and we need to ensure 4-bytes(of LLCP) + the // extended length bytes here. if (longBufferForDecryption_ == null) //we ddon't need to do this if it's data stream encryption { ensureBLayerDataInBuffer(4 + 4); } // The ddmScalarLen_ we peek here does not include the LLCP and the extended length bytes // themselves. So we will add those back to the ddmScalarLen_ so it can be adjusted // correctly in parseLengthAndMatchCodePoint(). (since the adjustLengths() method will // subtract the length from ddmScalarLen_) peekedLength_ = ((buffer_[pos_ + 4] & 0xff) << 24) + ((buffer_[pos_ + 5] & 0xff) << 16) + ((buffer_[pos_ + 6] & 0xff) << 8) + ((buffer_[pos_ + 7] & 0xff) << 0); break; case 0: peekedLength_ = -1; // this ddm is streamed, so set -1 -> length unknown break; default: doSyntaxrmSemantics(CodePoint.SYNERRCD_INCORRECT_EXTENDED_LEN); } }
private final void readExtendedLength() throws DisconnectException { int numberOfExtendedLenBytes = (ddmScalarLen_ - 0x8000); // fix scroll problem was - 4 int adjustSize = 0; switch (numberOfExtendedLenBytes) { case 4: ensureBLayerDataInBuffer(4); ddmScalarLen_ = ((buffer_[pos_++] & 0xff) << 24) + ((buffer_[pos_++] & 0xff) << 16) + ((buffer_[pos_++] & 0xff) << 8) + ((buffer_[pos_++] & 0xff) << 0); adjustSize = 4; break; case 0: ddmScalarLen_ = -1; adjustSize = 0; break; default: doSyntaxrmSemantics(CodePoint.SYNERRCD_INCORRECT_EXTENDED_LEN); } adjustCollectionAndDssLengths(adjustSize); /* // adjust the lengths here. this is a special case since the // extended length bytes do not include their own length. for (int i = 0; i <= topDdmCollectionStack_; i++) { ddmCollectionLenStack_[i] -= adjustSize; } dssLength_ -= adjustSize; */ }
private final void readExtendedLength() throws DisconnectException { int numberOfExtendedLenBytes = (ddmScalarLen_ - 0x8000); // fix scroll problem was - 4 int adjustSize = 0; switch (numberOfExtendedLenBytes) { case 4: ensureBLayerDataInBuffer(4); ddmScalarLen_ = ((buffer_[pos_++] & 0xff) << 24) + ((buffer_[pos_++] & 0xff) << 16) + ((buffer_[pos_++] & 0xff) << 8) + ((buffer_[pos_++] & 0xff) << 0); adjustSize = 4; break; case 0: ddmScalarLen_ = -1; adjustSize = 0; break; default: doSyntaxrmSemantics(CodePoint.SYNERRCD_INCORRECT_EXTENDED_LEN); } adjustCollectionAndDssLengths(adjustSize); /* // adjust the lengths here. this is a special case since the // extended length bytes do not include their own length. for (int i = 0; i <= topDdmCollectionStack_; i++) { ddmCollectionLenStack_[i] -= adjustSize; } dssLength_ -= adjustSize; */ }