public int decode(InputStream is, boolean withTag) throws IOException { int codeLength = 0; if (withTag) { codeLength += tag.decodeAndCheck(is); } codeLength += super.decode(is, false); return codeLength; }
public int encode(OutputStream reverseOS, boolean withTag) throws IOException { int codeLength; codeLength = super.encode(reverseOS, false); if (withTag) { codeLength += tag.encode(reverseOS); } return codeLength; }
number = new BerNumericString(); subCodeLength += number.decode(is, false); subCodeLength += berTag.decode(is); subAddress = new BerNumericString(); subCodeLength += subAddress.decode(is, false); subCodeLength += berTag.decode(is); number = new BerNumericString(); subCodeLength += number.decode(is, false); if (subCodeLength == totalLength) { return codeLength; subAddress = new BerNumericString(); subCodeLength += subAddress.decode(is, false); if (subCodeLength == totalLength) { return codeLength;
public int decode(InputStream is, BerTag berTag) throws IOException { int codeLength = 0; BerTag passedTag = berTag; if (berTag == null) { berTag = new BerTag(); codeLength += berTag.decode(is); } if (berTag.equals(BerNumericString.tag)) { numericCode = new BerNumericString(); codeLength += numericCode.decode(is, false); return codeLength; } if (berTag.equals(BerPrintableString.tag)) { printableCode = new BerPrintableString(); codeLength += printableCode.decode(is, false); return codeLength; } if (passedTag != null) { return 0; } throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); }
public int decode(InputStream is, BerTag berTag) throws IOException { int codeLength = 0; BerTag passedTag = berTag; if (berTag == null) { berTag = new BerTag(); codeLength += berTag.decode(is); } if (berTag.equals(BerNumericString.tag)) { numeric = new BerNumericString(); codeLength += numeric.decode(is, false); return codeLength; } if (berTag.equals(BerPrintableString.tag)) { printable = new BerPrintableString(); codeLength += printable.decode(is, false); return codeLength; } if (passedTag != null) { return 0; } throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); }
public int encode(OutputStream reverseOS) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { reverseOS.write(code[i]); } return code.length; } int codeLength = 0; if (iso3166Alpha2Code != null) { codeLength += iso3166Alpha2Code.encode(reverseOS, true); return codeLength; } if (x121DccCode != null) { codeLength += x121DccCode.encode(reverseOS, true); return codeLength; } throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); }
public int decode(InputStream is, BerTag berTag) throws IOException { int codeLength = 0; BerTag passedTag = berTag; if (berTag == null) { berTag = new BerTag(); codeLength += berTag.decode(is); } if (berTag.equals(BerNumericString.tag)) { x121DccCode = new BerNumericString(); codeLength += x121DccCode.decode(is, false); return codeLength; } if (berTag.equals(BerPrintableString.tag)) { iso3166Alpha2Code = new BerPrintableString(); codeLength += iso3166Alpha2Code.decode(is, false); return codeLength; } if (passedTag != null) { return 0; } throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); }
public int encode(OutputStream reverseOS) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { reverseOS.write(code[i]); } return code.length; } int codeLength = 0; if (printableCode != null) { codeLength += printableCode.encode(reverseOS, true); return codeLength; } if (numericCode != null) { codeLength += numericCode.encode(reverseOS, true); return codeLength; } throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); }
public int decode(InputStream is, boolean withTag) throws IOException { int codeLength = 0; BerLength length = new BerLength(); BerTag berTag = new BerTag(); if (withTag) { codeLength += tag.decodeAndCheck(is); } codeLength += length.decode(is); codeLength += berTag.decode(is); if (berTag.equals(BerNumericString.tag)) { numeric = new BerNumericString(); codeLength += numeric.decode(is, false); return codeLength; } if (berTag.equals(BerPrintableString.tag)) { printable = new BerPrintableString(); codeLength += printable.decode(is, false); return codeLength; } throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); }
public int encode(OutputStream reverseOS) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { reverseOS.write(code[i]); } return code.length; } int codeLength = 0; if (printable != null) { codeLength += printable.encode(reverseOS, true); return codeLength; } if (numeric != null) { codeLength += numeric.encode(reverseOS, true); return codeLength; } throw new IOException("Error encoding CHOICE: No element of CHOICE was selected."); }
public int decode(InputStream is, boolean withTag) throws IOException { int codeLength = 0; BerLength length = new BerLength(); BerTag berTag = new BerTag(); if (withTag) { codeLength += tag.decodeAndCheck(is); } codeLength += length.decode(is); codeLength += berTag.decode(is); if (berTag.equals(BerNumericString.tag)) { x121DccCode = new BerNumericString(); codeLength += x121DccCode.decode(is, false); return codeLength; } if (berTag.equals(BerPrintableString.tag)) { iso3166Alpha2Code = new BerPrintableString(); codeLength += iso3166Alpha2Code.decode(is, false); return codeLength; } throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); }
public int encode(OutputStream reverseOS, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { reverseOS.write(code[i]); } if (withTag) { return tag.encode(reverseOS) + code.length; } return code.length; } int codeLength = 0; if (subAddress != null) { codeLength += subAddress.encode(reverseOS, false); // write tag: CONTEXT_CLASS, PRIMITIVE, 1 reverseOS.write(0x81); codeLength += 1; } codeLength += number.encode(reverseOS, false); // write tag: CONTEXT_CLASS, PRIMITIVE, 0 reverseOS.write(0x80); codeLength += 1; codeLength += BerLength.encodeLength(reverseOS, codeLength); if (withTag) { codeLength += tag.encode(reverseOS); } return codeLength; }
numericString = new BerNumericString(); subCodeLength += numericString.decode(is, false); subCodeLength += berTag.decode(is); numericString = new BerNumericString(); subCodeLength += numericString.decode(is, false); subCodeLength += berTag.decode(is);
codeLength += numeric.encode(reverseOS, true); codeLength += BerLength.encodeLength(reverseOS, codeLength); if (withTag) {
codeLength += x121DccCode.encode(reverseOS, true); codeLength += BerLength.encodeLength(reverseOS, codeLength); if (withTag) {
codeLength += numericString.encode(reverseOS, true);