public static ArrayList<VariableBinding> decodeVariableBindings(BERInputStream inputStream) throws IOException { BER.MutableByte pduType; pduType = new BER.MutableByte(); int vbLength = BER.decodeHeader(inputStream, pduType); if (pduType.getValue() != BER.SEQUENCE) { throw new IOException("Encountered invalid tag, SEQUENCE expected: " + pduType.getValue()); } // rest read count int startPos = (int) inputStream.getPosition(); ArrayList<VariableBinding> variableBindings = new ArrayList<>(); while (inputStream.getPosition() - startPos < vbLength) { VariableBinding vb = new VariableBinding(); vb.decodeBER(inputStream); variableBindings.add(vb); } if (inputStream.getPosition() - startPos != vbLength) { throw new IOException("Length of VB sequence (" + vbLength + ") does not match real length: " + ((int) inputStream.getPosition() - startPos)); } return variableBindings; }
while (inputStream.getPosition() - startPos < vbLength) { VariableBinding vb = new VariableBinding(); vb.decodeBER(inputStream); variableBindings.add(vb);
while (inputStream.getPosition() - startPos < vbLength) { VariableBinding vb = new VariableBinding(); vb.decodeBER(inputStream); variableBindings.add(vb);
while (inputStream.getPosition() - startPos < vbLength) { VariableBinding vb = new VariableBinding(); vb.decodeBER(inputStream); if (!isVariableV1(vb.getVariable())) { throw new MessageException("Counter64 encountered in SNMPv1 PDU "+
while (inputStream.getPosition() - startPos < vbLength) { VariableBinding vb = new VariableBinding(); vb.decodeBER(inputStream); if (!isVariableV1(vb.getVariable())) { throw new MessageException("Counter64 encountered in SNMPv1 PDU "+
while (inputStream.getPosition() - startPos < vbLength) { VariableBinding vb = new VariableBinding(); vb.decodeBER(inputStream); if (!isVariableV1(vb.getVariable())) { throw new MessageException("Counter64 encountered in SNMPv1 PDU "+