| /** |
| * This class file was automatically generated by jASN1 v1.8.2 (http://www.openmuc.org) |
| */ |
| |
| package org.onosproject.xran.asn1lib.pdu; |
| |
| import com.fasterxml.jackson.annotation.JsonIgnore; |
| import com.fasterxml.jackson.annotation.JsonValue; |
| import org.onosproject.xran.asn1lib.api.CRNTI; |
| import org.onosproject.xran.asn1lib.api.ECGI; |
| import org.onosproject.xran.asn1lib.api.QCI; |
| import org.onosproject.xran.asn1lib.ber.BerByteArrayOutputStream; |
| import org.onosproject.xran.asn1lib.ber.BerLength; |
| import org.onosproject.xran.asn1lib.ber.BerTag; |
| import org.onosproject.xran.asn1lib.ber.types.BerInteger; |
| |
| import java.io.IOException; |
| import java.io.InputStream; |
| import java.io.Serializable; |
| import java.util.ArrayList; |
| import java.util.Iterator; |
| import java.util.List; |
| |
| public class PDCPMeasReportPerUe implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private ECGI ecgi = null; |
| private CRNTI crnti = null; |
| private QciVals qciVals = null; |
| private DataVolDl dataVolDl = null; |
| private DataVolUl dataVolUl = null; |
| private PktDelayDl pktDelayDl = null; |
| private PktDelayUl pktDelayUl = null; |
| private PktDiscardRateDl pktDiscardRateDl = null; |
| private PktLossRateDl pktLossRateDl = null; |
| private PktLossRateUl pktLossRateUl = null; |
| private ThroughputDl throughputDl = null; |
| private ThroughputUl throughputUl = null; |
| |
| public PDCPMeasReportPerUe() { |
| } |
| |
| public PDCPMeasReportPerUe(byte[] code) { |
| this.code = code; |
| } |
| |
| public ECGI getEcgi() { |
| return ecgi; |
| } |
| |
| public void setEcgi(ECGI ecgi) { |
| this.ecgi = ecgi; |
| } |
| |
| public CRNTI getCrnti() { |
| return crnti; |
| } |
| |
| public void setCrnti(CRNTI crnti) { |
| this.crnti = crnti; |
| } |
| |
| public QciVals getQciVals() { |
| return qciVals; |
| } |
| |
| public void setQciVals(QciVals qciVals) { |
| this.qciVals = qciVals; |
| } |
| |
| public DataVolDl getDataVolDl() { |
| return dataVolDl; |
| } |
| |
| public void setDataVolDl(DataVolDl dataVolDl) { |
| this.dataVolDl = dataVolDl; |
| } |
| |
| public DataVolUl getDataVolUl() { |
| return dataVolUl; |
| } |
| |
| public void setDataVolUl(DataVolUl dataVolUl) { |
| this.dataVolUl = dataVolUl; |
| } |
| |
| public PktDelayDl getPktDelayDl() { |
| return pktDelayDl; |
| } |
| |
| public void setPktDelayDl(PktDelayDl pktDelayDl) { |
| this.pktDelayDl = pktDelayDl; |
| } |
| |
| public PktDelayUl getPktDelayUl() { |
| return pktDelayUl; |
| } |
| |
| public void setPktDelayUl(PktDelayUl pktDelayUl) { |
| this.pktDelayUl = pktDelayUl; |
| } |
| |
| public PktDiscardRateDl getPktDiscardRateDl() { |
| return pktDiscardRateDl; |
| } |
| |
| public void setPktDiscardRateDl(PktDiscardRateDl pktDiscardRateDl) { |
| this.pktDiscardRateDl = pktDiscardRateDl; |
| } |
| |
| public PktLossRateDl getPktLossRateDl() { |
| return pktLossRateDl; |
| } |
| |
| public void setPktLossRateDl(PktLossRateDl pktLossRateDl) { |
| this.pktLossRateDl = pktLossRateDl; |
| } |
| |
| public PktLossRateUl getPktLossRateUl() { |
| return pktLossRateUl; |
| } |
| |
| public void setPktLossRateUl(PktLossRateUl pktLossRateUl) { |
| this.pktLossRateUl = pktLossRateUl; |
| } |
| |
| public ThroughputDl getThroughputDl() { |
| return throughputDl; |
| } |
| |
| public void setThroughputDl(ThroughputDl throughputDl) { |
| this.throughputDl = throughputDl; |
| } |
| |
| public ThroughputUl getThroughputUl() { |
| return throughputUl; |
| } |
| |
| public void setThroughputUl(ThroughputUl throughputUl) { |
| this.throughputUl = throughputUl; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| codeLength += throughputUl.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 11 |
| os.write(0xAB); |
| codeLength += 1; |
| |
| codeLength += throughputDl.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 10 |
| os.write(0xAA); |
| codeLength += 1; |
| |
| codeLength += pktLossRateUl.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 9 |
| os.write(0xA9); |
| codeLength += 1; |
| |
| codeLength += pktLossRateDl.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 8 |
| os.write(0xA8); |
| codeLength += 1; |
| |
| codeLength += pktDiscardRateDl.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 7 |
| os.write(0xA7); |
| codeLength += 1; |
| |
| codeLength += pktDelayUl.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 6 |
| os.write(0xA6); |
| codeLength += 1; |
| |
| codeLength += pktDelayDl.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 5 |
| os.write(0xA5); |
| codeLength += 1; |
| |
| codeLength += dataVolUl.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 |
| os.write(0xA4); |
| codeLength += 1; |
| |
| codeLength += dataVolDl.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 3 |
| os.write(0xA3); |
| codeLength += 1; |
| |
| codeLength += qciVals.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 |
| os.write(0xA2); |
| codeLength += 1; |
| |
| codeLength += crnti.encode(os, false); |
| // write tag: CONTEXT_CLASS, PRIMITIVE, 1 |
| os.write(0x81); |
| codeLength += 1; |
| |
| codeLength += ecgi.encode(os, false); |
| // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 |
| os.write(0xA0); |
| codeLength += 1; |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| BerTag berTag = new BerTag(); |
| |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| |
| int totalLength = length.val; |
| codeLength += totalLength; |
| |
| subCodeLength += berTag.decode(is); |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { |
| ecgi = new ECGI(); |
| subCodeLength += ecgi.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { |
| crnti = new CRNTI(); |
| subCodeLength += crnti.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { |
| qciVals = new QciVals(); |
| subCodeLength += qciVals.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) { |
| dataVolDl = new DataVolDl(); |
| subCodeLength += dataVolDl.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { |
| dataVolUl = new DataVolUl(); |
| subCodeLength += dataVolUl.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) { |
| pktDelayDl = new PktDelayDl(); |
| subCodeLength += pktDelayDl.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) { |
| pktDelayUl = new PktDelayUl(); |
| subCodeLength += pktDelayUl.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 7)) { |
| pktDiscardRateDl = new PktDiscardRateDl(); |
| subCodeLength += pktDiscardRateDl.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) { |
| pktLossRateDl = new PktLossRateDl(); |
| subCodeLength += pktLossRateDl.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 9)) { |
| pktLossRateUl = new PktLossRateUl(); |
| subCodeLength += pktLossRateUl.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 10)) { |
| throughputDl = new ThroughputDl(); |
| subCodeLength += throughputDl.decode(is, false); |
| subCodeLength += berTag.decode(is); |
| } else { |
| throw new IOException("Tag does not match the mandatory sequence element tag."); |
| } |
| |
| if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 11)) { |
| throughputUl = new ThroughputUl(); |
| subCodeLength += throughputUl.decode(is, false); |
| if (subCodeLength == totalLength) { |
| return codeLength; |
| } |
| } |
| throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength); |
| |
| |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{"); |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (ecgi != null) { |
| sb.append("ecgi: "); |
| ecgi.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("ecgi: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (crnti != null) { |
| sb.append("crnti: ").append(crnti); |
| } else { |
| sb.append("crnti: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (qciVals != null) { |
| sb.append("qciVals: "); |
| qciVals.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("qciVals: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (dataVolDl != null) { |
| sb.append("dataVolDl: "); |
| dataVolDl.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("dataVolDl: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (dataVolUl != null) { |
| sb.append("dataVolUl: "); |
| dataVolUl.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("dataVolUl: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (pktDelayDl != null) { |
| sb.append("pktDelayDl: "); |
| pktDelayDl.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("pktDelayDl: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (pktDelayUl != null) { |
| sb.append("pktDelayUl: "); |
| pktDelayUl.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("pktDelayUl: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (pktDiscardRateDl != null) { |
| sb.append("pktDiscardRateDl: "); |
| pktDiscardRateDl.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("pktDiscardRateDl: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (pktLossRateDl != null) { |
| sb.append("pktLossRateDl: "); |
| pktLossRateDl.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("pktLossRateDl: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (pktLossRateUl != null) { |
| sb.append("pktLossRateUl: "); |
| pktLossRateUl.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("pktLossRateUl: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (throughputDl != null) { |
| sb.append("throughputDl: "); |
| throughputDl.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("throughputDl: <empty-required-field>"); |
| } |
| |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (throughputUl != null) { |
| sb.append("throughputUl: "); |
| throughputUl.appendAsString(sb, indentLevel + 1); |
| } else { |
| sb.append("throughputUl: <empty-required-field>"); |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| public static class QciVals implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<QCI> seqOf = null; |
| |
| public QciVals() { |
| seqOf = new ArrayList<QCI>(); |
| } |
| |
| public QciVals(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<QCI> getQCI() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<QCI>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| QCI element = new QCI(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<QCI> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| public static class DataVolDl implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<BerInteger> seqOf = null; |
| |
| public DataVolDl() { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| |
| public DataVolDl(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<BerInteger> getBerInteger() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| BerInteger element = new BerInteger(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<BerInteger> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| public static class DataVolUl implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<BerInteger> seqOf = null; |
| |
| public DataVolUl() { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| |
| public DataVolUl(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<BerInteger> getBerInteger() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| BerInteger element = new BerInteger(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<BerInteger> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| public static class PktDelayDl implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<BerInteger> seqOf = null; |
| |
| public PktDelayDl() { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| |
| public PktDelayDl(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<BerInteger> getBerInteger() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| BerInteger element = new BerInteger(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<BerInteger> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| public static class PktDelayUl implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<BerInteger> seqOf = null; |
| |
| public PktDelayUl() { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| |
| public PktDelayUl(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<BerInteger> getBerInteger() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| BerInteger element = new BerInteger(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<BerInteger> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| public static class PktDiscardRateDl implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<BerInteger> seqOf = null; |
| |
| public PktDiscardRateDl() { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| |
| public PktDiscardRateDl(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<BerInteger> getBerInteger() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| BerInteger element = new BerInteger(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<BerInteger> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| public static class PktLossRateDl implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<BerInteger> seqOf = null; |
| |
| public PktLossRateDl() { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| |
| public PktLossRateDl(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<BerInteger> getBerInteger() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| BerInteger element = new BerInteger(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<BerInteger> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| public static class PktLossRateUl implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<BerInteger> seqOf = null; |
| |
| public PktLossRateUl() { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| |
| public PktLossRateUl(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<BerInteger> getBerInteger() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| BerInteger element = new BerInteger(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<BerInteger> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| public static class ThroughputDl implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<BerInteger> seqOf = null; |
| |
| public ThroughputDl() { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| |
| public ThroughputDl(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<BerInteger> getBerInteger() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| BerInteger element = new BerInteger(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<BerInteger> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| public static class ThroughputUl implements Serializable { |
| |
| public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| private static final long serialVersionUID = 1L; |
| |
| @JsonIgnore |
| public byte[] code = null; |
| private List<BerInteger> seqOf = null; |
| |
| public ThroughputUl() { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| |
| public ThroughputUl(byte[] code) { |
| this.code = code; |
| } |
| |
| |
| @JsonValue |
| public List<BerInteger> getBerInteger() { |
| if (seqOf == null) { |
| seqOf = new ArrayList<BerInteger>(); |
| } |
| return seqOf; |
| } |
| |
| public int encode(BerByteArrayOutputStream os) throws IOException { |
| return encode(os, true); |
| } |
| |
| public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| |
| if (code != null) { |
| for (int i = code.length - 1; i >= 0; i--) { |
| os.write(code[i]); |
| } |
| if (withTag) { |
| return tag.encode(os) + code.length; |
| } |
| return code.length; |
| } |
| |
| int codeLength = 0; |
| for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| codeLength += seqOf.get(i).encode(os, true); |
| } |
| |
| codeLength += BerLength.encodeLength(os, codeLength); |
| |
| if (withTag) { |
| codeLength += tag.encode(os); |
| } |
| |
| return codeLength; |
| } |
| |
| public int decode(InputStream is) throws IOException { |
| return decode(is, true); |
| } |
| |
| public int decode(InputStream is, boolean withTag) throws IOException { |
| int codeLength = 0; |
| int subCodeLength = 0; |
| if (withTag) { |
| codeLength += tag.decodeAndCheck(is); |
| } |
| |
| BerLength length = new BerLength(); |
| codeLength += length.decode(is); |
| int totalLength = length.val; |
| |
| while (subCodeLength < totalLength) { |
| BerInteger element = new BerInteger(); |
| subCodeLength += element.decode(is, true); |
| seqOf.add(element); |
| } |
| if (subCodeLength != totalLength) { |
| throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| |
| } |
| codeLength += subCodeLength; |
| |
| return codeLength; |
| } |
| |
| public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| encode(os, false); |
| code = os.getArray(); |
| } |
| |
| public String toString() { |
| StringBuilder sb = new StringBuilder(); |
| appendAsString(sb, 0); |
| return sb.toString(); |
| } |
| |
| public void appendAsString(StringBuilder sb, int indentLevel) { |
| |
| sb.append("{\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| if (seqOf == null) { |
| sb.append("null"); |
| } else { |
| Iterator<BerInteger> it = seqOf.iterator(); |
| if (it.hasNext()) { |
| sb.append(it.next()); |
| while (it.hasNext()) { |
| sb.append(",\n"); |
| for (int i = 0; i < indentLevel + 1; i++) { |
| sb.append("\t"); |
| } |
| sb.append(it.next()); |
| } |
| } |
| } |
| |
| sb.append("\n"); |
| for (int i = 0; i < indentLevel; i++) { |
| sb.append("\t"); |
| } |
| sb.append("}"); |
| } |
| |
| } |
| |
| } |
| |