public int encode(OutputStream reverseOS, boolean withTag) throws IOException { int codeLength; codeLength = super.encode(reverseOS, false); if (withTag) { codeLength += tag.encode(reverseOS); } return codeLength; }
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 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 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 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; }
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);