slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1 | /** |
| 2 | * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org) |
| 3 | */ |
| 4 | |
| 5 | package org.onosproject.xran.codecs.api; |
| 6 | |
| 7 | import java.io.IOException; |
| 8 | import java.io.EOFException; |
| 9 | import java.io.InputStream; |
| 10 | import java.util.List; |
| 11 | import java.util.ArrayList; |
| 12 | import java.util.Iterator; |
| 13 | import java.io.UnsupportedEncodingException; |
| 14 | import java.math.BigInteger; |
| 15 | import java.io.Serializable; |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 16 | |
| 17 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 18 | import com.fasterxml.jackson.annotation.JsonValue; |
| 19 | import org.onosproject.xran.codecs.ber.*; |
| 20 | import org.onosproject.xran.codecs.ber.types.*; |
| 21 | import org.onosproject.xran.codecs.ber.types.string.*; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 22 | |
| 23 | |
| 24 | public class SchedMeasRepPerServCell implements Serializable { |
| 25 | |
| 26 | private static final long serialVersionUID = 1L; |
| 27 | |
| 28 | public static class QciVals implements Serializable { |
| 29 | |
| 30 | private static final long serialVersionUID = 1L; |
| 31 | |
| 32 | public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 33 | @JsonIgnore |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 34 | public byte[] code = null; |
| 35 | private List<QCI> seqOf = null; |
| 36 | |
| 37 | public QciVals() { |
| 38 | seqOf = new ArrayList<QCI>(); |
| 39 | } |
| 40 | |
| 41 | public QciVals(byte[] code) { |
| 42 | this.code = code; |
| 43 | } |
| 44 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 45 | @JsonValue |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 46 | public List<QCI> getQCI() { |
| 47 | if (seqOf == null) { |
| 48 | seqOf = new ArrayList<QCI>(); |
| 49 | } |
| 50 | return seqOf; |
| 51 | } |
| 52 | |
| 53 | public void setQCI(QCI qci) { |
| 54 | seqOf.add(qci); |
| 55 | } |
| 56 | |
| 57 | public int encode(BerByteArrayOutputStream os) throws IOException { |
| 58 | return encode(os, true); |
| 59 | } |
| 60 | |
| 61 | public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| 62 | |
| 63 | if (code != null) { |
| 64 | for (int i = code.length - 1; i >= 0; i--) { |
| 65 | os.write(code[i]); |
| 66 | } |
| 67 | if (withTag) { |
| 68 | return tag.encode(os) + code.length; |
| 69 | } |
| 70 | return code.length; |
| 71 | } |
| 72 | |
| 73 | int codeLength = 0; |
| 74 | for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| 75 | codeLength += seqOf.get(i).encode(os, true); |
| 76 | } |
| 77 | |
| 78 | codeLength += BerLength.encodeLength(os, codeLength); |
| 79 | |
| 80 | if (withTag) { |
| 81 | codeLength += tag.encode(os); |
| 82 | } |
| 83 | |
| 84 | return codeLength; |
| 85 | } |
| 86 | |
| 87 | public int decode(InputStream is) throws IOException { |
| 88 | return decode(is, true); |
| 89 | } |
| 90 | |
| 91 | public int decode(InputStream is, boolean withTag) throws IOException { |
| 92 | int codeLength = 0; |
| 93 | int subCodeLength = 0; |
| 94 | if (withTag) { |
| 95 | codeLength += tag.decodeAndCheck(is); |
| 96 | } |
| 97 | |
| 98 | BerLength length = new BerLength(); |
| 99 | codeLength += length.decode(is); |
| 100 | int totalLength = length.val; |
| 101 | |
| 102 | while (subCodeLength < totalLength) { |
| 103 | QCI element = new QCI(); |
| 104 | subCodeLength += element.decode(is, true); |
| 105 | seqOf.add(element); |
| 106 | } |
| 107 | if (subCodeLength != totalLength) { |
| 108 | throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| 109 | |
| 110 | } |
| 111 | codeLength += subCodeLength; |
| 112 | |
| 113 | return codeLength; |
| 114 | } |
| 115 | |
| 116 | public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| 117 | BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| 118 | encode(os, false); |
| 119 | code = os.getArray(); |
| 120 | } |
| 121 | |
| 122 | public String toString() { |
| 123 | StringBuilder sb = new StringBuilder(); |
| 124 | appendAsString(sb, 0); |
| 125 | return sb.toString(); |
| 126 | } |
| 127 | |
| 128 | public void appendAsString(StringBuilder sb, int indentLevel) { |
| 129 | |
| 130 | sb.append("[\n"); |
| 131 | for (int i = 0; i < indentLevel + 1; i++) { |
| 132 | sb.append("\t"); |
| 133 | } |
| 134 | if (seqOf == null) { |
| 135 | // sb.append("null"); |
| 136 | } |
| 137 | else { |
| 138 | Iterator<QCI> it = seqOf.iterator(); |
| 139 | if (it.hasNext()) { |
| 140 | sb.append(it.next()); |
| 141 | while (it.hasNext()) { |
| 142 | sb.append(",\n"); |
| 143 | for (int i = 0; i < indentLevel + 1; i++) { |
| 144 | sb.append("\t"); |
| 145 | } |
| 146 | sb.append(it.next()); |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | sb.append("\n"); |
| 152 | for (int i = 0; i < indentLevel; i++) { |
| 153 | sb.append("\t"); |
| 154 | } |
| 155 | sb.append("]"); |
| 156 | } |
| 157 | |
| 158 | } |
| 159 | |
| 160 | public static class McsDl implements Serializable { |
| 161 | |
| 162 | private static final long serialVersionUID = 1L; |
| 163 | |
| 164 | public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 165 | @JsonIgnore public byte[] code = null; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 166 | private List<BerInteger> seqOf = null; |
| 167 | |
| 168 | public McsDl() { |
| 169 | seqOf = new ArrayList<BerInteger>(); |
| 170 | } |
| 171 | |
| 172 | public McsDl(byte[] code) { |
| 173 | this.code = code; |
| 174 | } |
| 175 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 176 | @JsonValue public List<BerInteger> getBerInteger() { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 177 | if (seqOf == null) { |
| 178 | seqOf = new ArrayList<BerInteger>(); |
| 179 | } |
| 180 | return seqOf; |
| 181 | } |
| 182 | |
| 183 | public void setBerInteger(BerInteger berInteger) { |
| 184 | seqOf.add(berInteger); |
| 185 | } |
| 186 | |
| 187 | public int encode(BerByteArrayOutputStream os) throws IOException { |
| 188 | return encode(os, true); |
| 189 | } |
| 190 | |
| 191 | public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| 192 | |
| 193 | if (code != null) { |
| 194 | for (int i = code.length - 1; i >= 0; i--) { |
| 195 | os.write(code[i]); |
| 196 | } |
| 197 | if (withTag) { |
| 198 | return tag.encode(os) + code.length; |
| 199 | } |
| 200 | return code.length; |
| 201 | } |
| 202 | |
| 203 | int codeLength = 0; |
| 204 | for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| 205 | codeLength += seqOf.get(i).encode(os, true); |
| 206 | } |
| 207 | |
| 208 | codeLength += BerLength.encodeLength(os, codeLength); |
| 209 | |
| 210 | if (withTag) { |
| 211 | codeLength += tag.encode(os); |
| 212 | } |
| 213 | |
| 214 | return codeLength; |
| 215 | } |
| 216 | |
| 217 | public int decode(InputStream is) throws IOException { |
| 218 | return decode(is, true); |
| 219 | } |
| 220 | |
| 221 | public int decode(InputStream is, boolean withTag) throws IOException { |
| 222 | int codeLength = 0; |
| 223 | int subCodeLength = 0; |
| 224 | if (withTag) { |
| 225 | codeLength += tag.decodeAndCheck(is); |
| 226 | } |
| 227 | |
| 228 | BerLength length = new BerLength(); |
| 229 | codeLength += length.decode(is); |
| 230 | int totalLength = length.val; |
| 231 | |
| 232 | while (subCodeLength < totalLength) { |
| 233 | BerInteger element = new BerInteger(); |
| 234 | subCodeLength += element.decode(is, true); |
| 235 | seqOf.add(element); |
| 236 | } |
| 237 | if (subCodeLength != totalLength) { |
| 238 | throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| 239 | |
| 240 | } |
| 241 | codeLength += subCodeLength; |
| 242 | |
| 243 | return codeLength; |
| 244 | } |
| 245 | |
| 246 | public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| 247 | BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| 248 | encode(os, false); |
| 249 | code = os.getArray(); |
| 250 | } |
| 251 | |
| 252 | public String toString() { |
| 253 | StringBuilder sb = new StringBuilder(); |
| 254 | appendAsString(sb, 0); |
| 255 | return sb.toString(); |
| 256 | } |
| 257 | |
| 258 | public void appendAsString(StringBuilder sb, int indentLevel) { |
| 259 | |
| 260 | sb.append("[\n"); |
| 261 | for (int i = 0; i < indentLevel + 1; i++) { |
| 262 | sb.append("\t"); |
| 263 | } |
| 264 | if (seqOf == null) { |
| 265 | // sb.append("null"); |
| 266 | } |
| 267 | else { |
| 268 | Iterator<BerInteger> it = seqOf.iterator(); |
| 269 | if (it.hasNext()) { |
| 270 | sb.append(it.next()); |
| 271 | while (it.hasNext()) { |
| 272 | sb.append(",\n"); |
| 273 | for (int i = 0; i < indentLevel + 1; i++) { |
| 274 | sb.append("\t"); |
| 275 | } |
| 276 | sb.append(it.next()); |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | sb.append("\n"); |
| 282 | for (int i = 0; i < indentLevel; i++) { |
| 283 | sb.append("\t"); |
| 284 | } |
| 285 | sb.append("]"); |
| 286 | } |
| 287 | |
| 288 | } |
| 289 | |
| 290 | public static class NumSchedTtisDl implements Serializable { |
| 291 | |
| 292 | private static final long serialVersionUID = 1L; |
| 293 | |
| 294 | public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 295 | @JsonIgnore public byte[] code = null; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 296 | private List<BerInteger> seqOf = null; |
| 297 | |
| 298 | public NumSchedTtisDl() { |
| 299 | seqOf = new ArrayList<BerInteger>(); |
| 300 | } |
| 301 | |
| 302 | public NumSchedTtisDl(byte[] code) { |
| 303 | this.code = code; |
| 304 | } |
| 305 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 306 | @JsonValue public List<BerInteger> getBerInteger() { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 307 | if (seqOf == null) { |
| 308 | seqOf = new ArrayList<BerInteger>(); |
| 309 | } |
| 310 | return seqOf; |
| 311 | } |
| 312 | |
| 313 | public void setBerInteger(BerInteger berInteger) { |
| 314 | seqOf.add(berInteger); |
| 315 | } |
| 316 | |
| 317 | public int encode(BerByteArrayOutputStream os) throws IOException { |
| 318 | return encode(os, true); |
| 319 | } |
| 320 | |
| 321 | public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| 322 | |
| 323 | if (code != null) { |
| 324 | for (int i = code.length - 1; i >= 0; i--) { |
| 325 | os.write(code[i]); |
| 326 | } |
| 327 | if (withTag) { |
| 328 | return tag.encode(os) + code.length; |
| 329 | } |
| 330 | return code.length; |
| 331 | } |
| 332 | |
| 333 | int codeLength = 0; |
| 334 | for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| 335 | codeLength += seqOf.get(i).encode(os, true); |
| 336 | } |
| 337 | |
| 338 | codeLength += BerLength.encodeLength(os, codeLength); |
| 339 | |
| 340 | if (withTag) { |
| 341 | codeLength += tag.encode(os); |
| 342 | } |
| 343 | |
| 344 | return codeLength; |
| 345 | } |
| 346 | |
| 347 | public int decode(InputStream is) throws IOException { |
| 348 | return decode(is, true); |
| 349 | } |
| 350 | |
| 351 | public int decode(InputStream is, boolean withTag) throws IOException { |
| 352 | int codeLength = 0; |
| 353 | int subCodeLength = 0; |
| 354 | if (withTag) { |
| 355 | codeLength += tag.decodeAndCheck(is); |
| 356 | } |
| 357 | |
| 358 | BerLength length = new BerLength(); |
| 359 | codeLength += length.decode(is); |
| 360 | int totalLength = length.val; |
| 361 | |
| 362 | while (subCodeLength < totalLength) { |
| 363 | BerInteger element = new BerInteger(); |
| 364 | subCodeLength += element.decode(is, true); |
| 365 | seqOf.add(element); |
| 366 | } |
| 367 | if (subCodeLength != totalLength) { |
| 368 | throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| 369 | |
| 370 | } |
| 371 | codeLength += subCodeLength; |
| 372 | |
| 373 | return codeLength; |
| 374 | } |
| 375 | |
| 376 | public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| 377 | BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| 378 | encode(os, false); |
| 379 | code = os.getArray(); |
| 380 | } |
| 381 | |
| 382 | public String toString() { |
| 383 | StringBuilder sb = new StringBuilder(); |
| 384 | appendAsString(sb, 0); |
| 385 | return sb.toString(); |
| 386 | } |
| 387 | |
| 388 | public void appendAsString(StringBuilder sb, int indentLevel) { |
| 389 | |
| 390 | sb.append("[\n"); |
| 391 | for (int i = 0; i < indentLevel + 1; i++) { |
| 392 | sb.append("\t"); |
| 393 | } |
| 394 | if (seqOf == null) { |
| 395 | // sb.append("null"); |
| 396 | } |
| 397 | else { |
| 398 | Iterator<BerInteger> it = seqOf.iterator(); |
| 399 | if (it.hasNext()) { |
| 400 | sb.append(it.next()); |
| 401 | while (it.hasNext()) { |
| 402 | sb.append(",\n"); |
| 403 | for (int i = 0; i < indentLevel + 1; i++) { |
| 404 | sb.append("\t"); |
| 405 | } |
| 406 | sb.append(it.next()); |
| 407 | } |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | sb.append("\n"); |
| 412 | for (int i = 0; i < indentLevel; i++) { |
| 413 | sb.append("\t"); |
| 414 | } |
| 415 | sb.append("]"); |
| 416 | } |
| 417 | |
| 418 | } |
| 419 | |
| 420 | public static class McsUl implements Serializable { |
| 421 | |
| 422 | private static final long serialVersionUID = 1L; |
| 423 | |
| 424 | public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 425 | @JsonIgnore public byte[] code = null; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 426 | private List<BerInteger> seqOf = null; |
| 427 | |
| 428 | public McsUl() { |
| 429 | seqOf = new ArrayList<BerInteger>(); |
| 430 | } |
| 431 | |
| 432 | public McsUl(byte[] code) { |
| 433 | this.code = code; |
| 434 | } |
| 435 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 436 | @JsonValue public List<BerInteger> getBerInteger() { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 437 | if (seqOf == null) { |
| 438 | seqOf = new ArrayList<BerInteger>(); |
| 439 | } |
| 440 | return seqOf; |
| 441 | } |
| 442 | |
| 443 | public void setBerInteger(BerInteger berInteger) { |
| 444 | seqOf.add(berInteger); |
| 445 | } |
| 446 | |
| 447 | public int encode(BerByteArrayOutputStream os) throws IOException { |
| 448 | return encode(os, true); |
| 449 | } |
| 450 | |
| 451 | public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| 452 | |
| 453 | if (code != null) { |
| 454 | for (int i = code.length - 1; i >= 0; i--) { |
| 455 | os.write(code[i]); |
| 456 | } |
| 457 | if (withTag) { |
| 458 | return tag.encode(os) + code.length; |
| 459 | } |
| 460 | return code.length; |
| 461 | } |
| 462 | |
| 463 | int codeLength = 0; |
| 464 | for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| 465 | codeLength += seqOf.get(i).encode(os, true); |
| 466 | } |
| 467 | |
| 468 | codeLength += BerLength.encodeLength(os, codeLength); |
| 469 | |
| 470 | if (withTag) { |
| 471 | codeLength += tag.encode(os); |
| 472 | } |
| 473 | |
| 474 | return codeLength; |
| 475 | } |
| 476 | |
| 477 | public int decode(InputStream is) throws IOException { |
| 478 | return decode(is, true); |
| 479 | } |
| 480 | |
| 481 | public int decode(InputStream is, boolean withTag) throws IOException { |
| 482 | int codeLength = 0; |
| 483 | int subCodeLength = 0; |
| 484 | if (withTag) { |
| 485 | codeLength += tag.decodeAndCheck(is); |
| 486 | } |
| 487 | |
| 488 | BerLength length = new BerLength(); |
| 489 | codeLength += length.decode(is); |
| 490 | int totalLength = length.val; |
| 491 | |
| 492 | while (subCodeLength < totalLength) { |
| 493 | BerInteger element = new BerInteger(); |
| 494 | subCodeLength += element.decode(is, true); |
| 495 | seqOf.add(element); |
| 496 | } |
| 497 | if (subCodeLength != totalLength) { |
| 498 | throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| 499 | |
| 500 | } |
| 501 | codeLength += subCodeLength; |
| 502 | |
| 503 | return codeLength; |
| 504 | } |
| 505 | |
| 506 | public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| 507 | BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| 508 | encode(os, false); |
| 509 | code = os.getArray(); |
| 510 | } |
| 511 | |
| 512 | public String toString() { |
| 513 | StringBuilder sb = new StringBuilder(); |
| 514 | appendAsString(sb, 0); |
| 515 | return sb.toString(); |
| 516 | } |
| 517 | |
| 518 | public void appendAsString(StringBuilder sb, int indentLevel) { |
| 519 | |
| 520 | sb.append("[\n"); |
| 521 | for (int i = 0; i < indentLevel + 1; i++) { |
| 522 | sb.append("\t"); |
| 523 | } |
| 524 | if (seqOf == null) { |
| 525 | // sb.append("null"); |
| 526 | } |
| 527 | else { |
| 528 | Iterator<BerInteger> it = seqOf.iterator(); |
| 529 | if (it.hasNext()) { |
| 530 | sb.append(it.next()); |
| 531 | while (it.hasNext()) { |
| 532 | sb.append(",\n"); |
| 533 | for (int i = 0; i < indentLevel + 1; i++) { |
| 534 | sb.append("\t"); |
| 535 | } |
| 536 | sb.append(it.next()); |
| 537 | } |
| 538 | } |
| 539 | } |
| 540 | |
| 541 | sb.append("\n"); |
| 542 | for (int i = 0; i < indentLevel; i++) { |
| 543 | sb.append("\t"); |
| 544 | } |
| 545 | sb.append("]"); |
| 546 | } |
| 547 | |
| 548 | } |
| 549 | |
| 550 | public static class NumSchedTtisUl implements Serializable { |
| 551 | |
| 552 | private static final long serialVersionUID = 1L; |
| 553 | |
| 554 | public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 555 | @JsonIgnore public byte[] code = null; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 556 | private List<BerInteger> seqOf = null; |
| 557 | |
| 558 | public NumSchedTtisUl() { |
| 559 | seqOf = new ArrayList<BerInteger>(); |
| 560 | } |
| 561 | |
| 562 | public NumSchedTtisUl(byte[] code) { |
| 563 | this.code = code; |
| 564 | } |
| 565 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 566 | @JsonValue public List<BerInteger> getBerInteger() { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 567 | if (seqOf == null) { |
| 568 | seqOf = new ArrayList<BerInteger>(); |
| 569 | } |
| 570 | return seqOf; |
| 571 | } |
| 572 | |
| 573 | public void setBerInteger(BerInteger berInteger) { |
| 574 | seqOf.add(berInteger); |
| 575 | } |
| 576 | |
| 577 | public int encode(BerByteArrayOutputStream os) throws IOException { |
| 578 | return encode(os, true); |
| 579 | } |
| 580 | |
| 581 | public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| 582 | |
| 583 | if (code != null) { |
| 584 | for (int i = code.length - 1; i >= 0; i--) { |
| 585 | os.write(code[i]); |
| 586 | } |
| 587 | if (withTag) { |
| 588 | return tag.encode(os) + code.length; |
| 589 | } |
| 590 | return code.length; |
| 591 | } |
| 592 | |
| 593 | int codeLength = 0; |
| 594 | for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| 595 | codeLength += seqOf.get(i).encode(os, true); |
| 596 | } |
| 597 | |
| 598 | codeLength += BerLength.encodeLength(os, codeLength); |
| 599 | |
| 600 | if (withTag) { |
| 601 | codeLength += tag.encode(os); |
| 602 | } |
| 603 | |
| 604 | return codeLength; |
| 605 | } |
| 606 | |
| 607 | public int decode(InputStream is) throws IOException { |
| 608 | return decode(is, true); |
| 609 | } |
| 610 | |
| 611 | public int decode(InputStream is, boolean withTag) throws IOException { |
| 612 | int codeLength = 0; |
| 613 | int subCodeLength = 0; |
| 614 | if (withTag) { |
| 615 | codeLength += tag.decodeAndCheck(is); |
| 616 | } |
| 617 | |
| 618 | BerLength length = new BerLength(); |
| 619 | codeLength += length.decode(is); |
| 620 | int totalLength = length.val; |
| 621 | |
| 622 | while (subCodeLength < totalLength) { |
| 623 | BerInteger element = new BerInteger(); |
| 624 | subCodeLength += element.decode(is, true); |
| 625 | seqOf.add(element); |
| 626 | } |
| 627 | if (subCodeLength != totalLength) { |
| 628 | throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| 629 | |
| 630 | } |
| 631 | codeLength += subCodeLength; |
| 632 | |
| 633 | return codeLength; |
| 634 | } |
| 635 | |
| 636 | public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| 637 | BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| 638 | encode(os, false); |
| 639 | code = os.getArray(); |
| 640 | } |
| 641 | |
| 642 | public String toString() { |
| 643 | StringBuilder sb = new StringBuilder(); |
| 644 | appendAsString(sb, 0); |
| 645 | return sb.toString(); |
| 646 | } |
| 647 | |
| 648 | public void appendAsString(StringBuilder sb, int indentLevel) { |
| 649 | |
| 650 | sb.append("[\n"); |
| 651 | for (int i = 0; i < indentLevel + 1; i++) { |
| 652 | sb.append("\t"); |
| 653 | } |
| 654 | if (seqOf == null) { |
| 655 | // sb.append("null"); |
| 656 | } |
| 657 | else { |
| 658 | Iterator<BerInteger> it = seqOf.iterator(); |
| 659 | if (it.hasNext()) { |
| 660 | sb.append(it.next()); |
| 661 | while (it.hasNext()) { |
| 662 | sb.append(",\n"); |
| 663 | for (int i = 0; i < indentLevel + 1; i++) { |
| 664 | sb.append("\t"); |
| 665 | } |
| 666 | sb.append(it.next()); |
| 667 | } |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | sb.append("\n"); |
| 672 | for (int i = 0; i < indentLevel; i++) { |
| 673 | sb.append("\t"); |
| 674 | } |
| 675 | sb.append("]"); |
| 676 | } |
| 677 | |
| 678 | } |
| 679 | |
| 680 | public static class RankDl1 implements Serializable { |
| 681 | |
| 682 | private static final long serialVersionUID = 1L; |
| 683 | |
| 684 | public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 685 | @JsonIgnore public byte[] code = null; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 686 | private List<BerInteger> seqOf = null; |
| 687 | |
| 688 | public RankDl1() { |
| 689 | seqOf = new ArrayList<BerInteger>(); |
| 690 | } |
| 691 | |
| 692 | public RankDl1(byte[] code) { |
| 693 | this.code = code; |
| 694 | } |
| 695 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 696 | @JsonValue public List<BerInteger> getBerInteger() { |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 697 | if (seqOf == null) { |
| 698 | seqOf = new ArrayList<BerInteger>(); |
| 699 | } |
| 700 | return seqOf; |
| 701 | } |
| 702 | |
| 703 | public void setBerInteger(BerInteger berInteger) { |
| 704 | seqOf.add(berInteger); |
| 705 | } |
| 706 | |
| 707 | public int encode(BerByteArrayOutputStream os) throws IOException { |
| 708 | return encode(os, true); |
| 709 | } |
| 710 | |
| 711 | public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| 712 | |
| 713 | if (code != null) { |
| 714 | for (int i = code.length - 1; i >= 0; i--) { |
| 715 | os.write(code[i]); |
| 716 | } |
| 717 | if (withTag) { |
| 718 | return tag.encode(os) + code.length; |
| 719 | } |
| 720 | return code.length; |
| 721 | } |
| 722 | |
| 723 | int codeLength = 0; |
| 724 | for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| 725 | codeLength += seqOf.get(i).encode(os, true); |
| 726 | } |
| 727 | |
| 728 | codeLength += BerLength.encodeLength(os, codeLength); |
| 729 | |
| 730 | if (withTag) { |
| 731 | codeLength += tag.encode(os); |
| 732 | } |
| 733 | |
| 734 | return codeLength; |
| 735 | } |
| 736 | |
| 737 | public int decode(InputStream is) throws IOException { |
| 738 | return decode(is, true); |
| 739 | } |
| 740 | |
| 741 | public int decode(InputStream is, boolean withTag) throws IOException { |
| 742 | int codeLength = 0; |
| 743 | int subCodeLength = 0; |
| 744 | if (withTag) { |
| 745 | codeLength += tag.decodeAndCheck(is); |
| 746 | } |
| 747 | |
| 748 | BerLength length = new BerLength(); |
| 749 | codeLength += length.decode(is); |
| 750 | int totalLength = length.val; |
| 751 | |
| 752 | while (subCodeLength < totalLength) { |
| 753 | BerInteger element = new BerInteger(); |
| 754 | subCodeLength += element.decode(is, true); |
| 755 | seqOf.add(element); |
| 756 | } |
| 757 | if (subCodeLength != totalLength) { |
| 758 | throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| 759 | |
| 760 | } |
| 761 | codeLength += subCodeLength; |
| 762 | |
| 763 | return codeLength; |
| 764 | } |
| 765 | |
| 766 | public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| 767 | BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| 768 | encode(os, false); |
| 769 | code = os.getArray(); |
| 770 | } |
| 771 | |
| 772 | public String toString() { |
| 773 | StringBuilder sb = new StringBuilder(); |
| 774 | appendAsString(sb, 0); |
| 775 | return sb.toString(); |
| 776 | } |
| 777 | |
| 778 | public void appendAsString(StringBuilder sb, int indentLevel) { |
| 779 | |
| 780 | sb.append("[\n"); |
| 781 | for (int i = 0; i < indentLevel + 1; i++) { |
| 782 | sb.append("\t"); |
| 783 | } |
| 784 | if (seqOf == null) { |
| 785 | // sb.append("null"); |
| 786 | } |
| 787 | else { |
| 788 | Iterator<BerInteger> it = seqOf.iterator(); |
| 789 | if (it.hasNext()) { |
| 790 | sb.append(it.next()); |
| 791 | while (it.hasNext()) { |
| 792 | sb.append(",\n"); |
| 793 | for (int i = 0; i < indentLevel + 1; i++) { |
| 794 | sb.append("\t"); |
| 795 | } |
| 796 | sb.append(it.next()); |
| 797 | } |
| 798 | } |
| 799 | } |
| 800 | |
| 801 | sb.append("\n"); |
| 802 | for (int i = 0; i < indentLevel; i++) { |
| 803 | sb.append("\t"); |
| 804 | } |
| 805 | sb.append("]"); |
| 806 | } |
| 807 | |
| 808 | } |
| 809 | |
| 810 | public static class RankDl2 implements Serializable { |
| 811 | |
| 812 | private static final long serialVersionUID = 1L; |
| 813 | |
| 814 | public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 815 | @JsonIgnore public byte[] code = null; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 816 | private List<BerInteger> seqOf = null; |
| 817 | |
| 818 | public RankDl2() { |
| 819 | seqOf = new ArrayList<BerInteger>(); |
| 820 | } |
| 821 | |
| 822 | public RankDl2(byte[] code) { |
| 823 | this.code = code; |
| 824 | } |
| 825 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 826 | @JsonValue |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 827 | public List<BerInteger> getBerInteger() { |
| 828 | if (seqOf == null) { |
| 829 | seqOf = new ArrayList<BerInteger>(); |
| 830 | } |
| 831 | return seqOf; |
| 832 | } |
| 833 | |
| 834 | public void setBerInteger(BerInteger berInteger) { |
| 835 | seqOf.add(berInteger); |
| 836 | } |
| 837 | |
| 838 | public int encode(BerByteArrayOutputStream os) throws IOException { |
| 839 | return encode(os, true); |
| 840 | } |
| 841 | |
| 842 | public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| 843 | |
| 844 | if (code != null) { |
| 845 | for (int i = code.length - 1; i >= 0; i--) { |
| 846 | os.write(code[i]); |
| 847 | } |
| 848 | if (withTag) { |
| 849 | return tag.encode(os) + code.length; |
| 850 | } |
| 851 | return code.length; |
| 852 | } |
| 853 | |
| 854 | int codeLength = 0; |
| 855 | for (int i = (seqOf.size() - 1); i >= 0; i--) { |
| 856 | codeLength += seqOf.get(i).encode(os, true); |
| 857 | } |
| 858 | |
| 859 | codeLength += BerLength.encodeLength(os, codeLength); |
| 860 | |
| 861 | if (withTag) { |
| 862 | codeLength += tag.encode(os); |
| 863 | } |
| 864 | |
| 865 | return codeLength; |
| 866 | } |
| 867 | |
| 868 | public int decode(InputStream is) throws IOException { |
| 869 | return decode(is, true); |
| 870 | } |
| 871 | |
| 872 | public int decode(InputStream is, boolean withTag) throws IOException { |
| 873 | int codeLength = 0; |
| 874 | int subCodeLength = 0; |
| 875 | if (withTag) { |
| 876 | codeLength += tag.decodeAndCheck(is); |
| 877 | } |
| 878 | |
| 879 | BerLength length = new BerLength(); |
| 880 | codeLength += length.decode(is); |
| 881 | int totalLength = length.val; |
| 882 | |
| 883 | while (subCodeLength < totalLength) { |
| 884 | BerInteger element = new BerInteger(); |
| 885 | subCodeLength += element.decode(is, true); |
| 886 | seqOf.add(element); |
| 887 | } |
| 888 | if (subCodeLength != totalLength) { |
| 889 | throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength); |
| 890 | |
| 891 | } |
| 892 | codeLength += subCodeLength; |
| 893 | |
| 894 | return codeLength; |
| 895 | } |
| 896 | |
| 897 | public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| 898 | BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| 899 | encode(os, false); |
| 900 | code = os.getArray(); |
| 901 | } |
| 902 | |
| 903 | public String toString() { |
| 904 | StringBuilder sb = new StringBuilder(); |
| 905 | appendAsString(sb, 0); |
| 906 | return sb.toString(); |
| 907 | } |
| 908 | |
| 909 | public void appendAsString(StringBuilder sb, int indentLevel) { |
| 910 | |
| 911 | sb.append("[\n"); |
| 912 | for (int i = 0; i < indentLevel + 1; i++) { |
| 913 | sb.append("\t"); |
| 914 | } |
| 915 | if (seqOf == null) { |
| 916 | // sb.append("null"); |
| 917 | } |
| 918 | else { |
| 919 | Iterator<BerInteger> it = seqOf.iterator(); |
| 920 | if (it.hasNext()) { |
| 921 | sb.append(it.next()); |
| 922 | while (it.hasNext()) { |
| 923 | sb.append(",\n"); |
| 924 | for (int i = 0; i < indentLevel + 1; i++) { |
| 925 | sb.append("\t"); |
| 926 | } |
| 927 | sb.append(it.next()); |
| 928 | } |
| 929 | } |
| 930 | } |
| 931 | |
| 932 | sb.append("\n"); |
| 933 | for (int i = 0; i < indentLevel; i++) { |
| 934 | sb.append("\t"); |
| 935 | } |
| 936 | sb.append("]"); |
| 937 | } |
| 938 | |
| 939 | } |
| 940 | |
| 941 | public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16); |
| 942 | |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 943 | @JsonIgnore public byte[] code = null; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 944 | private PCIARFCN pciArfcn = null; |
| 945 | private QciVals qciVals = null; |
| 946 | private PRBUsage prbUsage = null; |
| 947 | private McsDl mcsDl = null; |
| 948 | private NumSchedTtisDl numSchedTtisDl = null; |
| 949 | private McsUl mcsUl = null; |
| 950 | private NumSchedTtisUl numSchedTtisUl = null; |
| 951 | private RankDl1 rankDl1 = null; |
| 952 | private RankDl2 rankDl2 = null; |
| 953 | |
| 954 | public SchedMeasRepPerServCell() { |
| 955 | } |
| 956 | |
| 957 | public SchedMeasRepPerServCell(byte[] code) { |
| 958 | this.code = code; |
| 959 | } |
| 960 | |
| 961 | public void setPciArfcn(PCIARFCN pciArfcn) { |
| 962 | this.pciArfcn = pciArfcn; |
| 963 | } |
| 964 | |
| 965 | public PCIARFCN getPciArfcn() { |
| 966 | return pciArfcn; |
| 967 | } |
| 968 | |
| 969 | public void setQciVals(QciVals qciVals) { |
| 970 | this.qciVals = qciVals; |
| 971 | } |
| 972 | |
| 973 | public QciVals getQciVals() { |
| 974 | return qciVals; |
| 975 | } |
| 976 | |
| 977 | public void setPrbUsage(PRBUsage prbUsage) { |
| 978 | this.prbUsage = prbUsage; |
| 979 | } |
| 980 | |
| 981 | public PRBUsage getPrbUsage() { |
| 982 | return prbUsage; |
| 983 | } |
| 984 | |
| 985 | public void setMcsDl(McsDl mcsDl) { |
| 986 | this.mcsDl = mcsDl; |
| 987 | } |
| 988 | |
| 989 | public McsDl getMcsDl() { |
| 990 | return mcsDl; |
| 991 | } |
| 992 | |
| 993 | public void setNumSchedTtisDl(NumSchedTtisDl numSchedTtisDl) { |
| 994 | this.numSchedTtisDl = numSchedTtisDl; |
| 995 | } |
| 996 | |
| 997 | public NumSchedTtisDl getNumSchedTtisDl() { |
| 998 | return numSchedTtisDl; |
| 999 | } |
| 1000 | |
| 1001 | public void setMcsUl(McsUl mcsUl) { |
| 1002 | this.mcsUl = mcsUl; |
| 1003 | } |
| 1004 | |
| 1005 | public McsUl getMcsUl() { |
| 1006 | return mcsUl; |
| 1007 | } |
| 1008 | |
| 1009 | public void setNumSchedTtisUl(NumSchedTtisUl numSchedTtisUl) { |
| 1010 | this.numSchedTtisUl = numSchedTtisUl; |
| 1011 | } |
| 1012 | |
| 1013 | public NumSchedTtisUl getNumSchedTtisUl() { |
| 1014 | return numSchedTtisUl; |
| 1015 | } |
| 1016 | |
| 1017 | public void setRankDl1(RankDl1 rankDl1) { |
| 1018 | this.rankDl1 = rankDl1; |
| 1019 | } |
| 1020 | |
| 1021 | public RankDl1 getRankDl1() { |
| 1022 | return rankDl1; |
| 1023 | } |
| 1024 | |
| 1025 | public void setRankDl2(RankDl2 rankDl2) { |
| 1026 | this.rankDl2 = rankDl2; |
| 1027 | } |
| 1028 | |
| 1029 | public RankDl2 getRankDl2() { |
| 1030 | return rankDl2; |
| 1031 | } |
| 1032 | |
| 1033 | public int encode(BerByteArrayOutputStream os) throws IOException { |
| 1034 | return encode(os, true); |
| 1035 | } |
| 1036 | |
| 1037 | public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { |
| 1038 | |
| 1039 | if (code != null) { |
| 1040 | for (int i = code.length - 1; i >= 0; i--) { |
| 1041 | os.write(code[i]); |
| 1042 | } |
| 1043 | if (withTag) { |
| 1044 | return tag.encode(os) + code.length; |
| 1045 | } |
| 1046 | return code.length; |
| 1047 | } |
| 1048 | |
| 1049 | int codeLength = 0; |
| 1050 | codeLength += rankDl2.encode(os, false); |
| 1051 | // write tag: CONTEXT_CLASS, CONSTRUCTED, 8 |
| 1052 | os.write(0xA8); |
| 1053 | codeLength += 1; |
| 1054 | |
| 1055 | codeLength += rankDl1.encode(os, false); |
| 1056 | // write tag: CONTEXT_CLASS, CONSTRUCTED, 7 |
| 1057 | os.write(0xA7); |
| 1058 | codeLength += 1; |
| 1059 | |
| 1060 | codeLength += numSchedTtisUl.encode(os, false); |
| 1061 | // write tag: CONTEXT_CLASS, CONSTRUCTED, 6 |
| 1062 | os.write(0xA6); |
| 1063 | codeLength += 1; |
| 1064 | |
| 1065 | codeLength += mcsUl.encode(os, false); |
| 1066 | // write tag: CONTEXT_CLASS, CONSTRUCTED, 5 |
| 1067 | os.write(0xA5); |
| 1068 | codeLength += 1; |
| 1069 | |
| 1070 | codeLength += numSchedTtisDl.encode(os, false); |
| 1071 | // write tag: CONTEXT_CLASS, CONSTRUCTED, 4 |
| 1072 | os.write(0xA4); |
| 1073 | codeLength += 1; |
| 1074 | |
| 1075 | codeLength += mcsDl.encode(os, false); |
| 1076 | // write tag: CONTEXT_CLASS, CONSTRUCTED, 3 |
| 1077 | os.write(0xA3); |
| 1078 | codeLength += 1; |
| 1079 | |
| 1080 | codeLength += prbUsage.encode(os, false); |
| 1081 | // write tag: CONTEXT_CLASS, CONSTRUCTED, 2 |
| 1082 | os.write(0xA2); |
| 1083 | codeLength += 1; |
| 1084 | |
| 1085 | codeLength += qciVals.encode(os, false); |
| 1086 | // write tag: CONTEXT_CLASS, CONSTRUCTED, 1 |
| 1087 | os.write(0xA1); |
| 1088 | codeLength += 1; |
| 1089 | |
| 1090 | codeLength += pciArfcn.encode(os, false); |
| 1091 | // write tag: CONTEXT_CLASS, CONSTRUCTED, 0 |
| 1092 | os.write(0xA0); |
| 1093 | codeLength += 1; |
| 1094 | |
| 1095 | codeLength += BerLength.encodeLength(os, codeLength); |
| 1096 | |
| 1097 | if (withTag) { |
| 1098 | codeLength += tag.encode(os); |
| 1099 | } |
| 1100 | |
| 1101 | return codeLength; |
| 1102 | |
| 1103 | } |
| 1104 | |
| 1105 | public int decode(InputStream is) throws IOException { |
| 1106 | return decode(is, true); |
| 1107 | } |
| 1108 | |
| 1109 | public int decode(InputStream is, boolean withTag) throws IOException { |
| 1110 | int codeLength = 0; |
| 1111 | int subCodeLength = 0; |
| 1112 | BerTag berTag = new BerTag(); |
| 1113 | |
| 1114 | if (withTag) { |
| 1115 | codeLength += tag.decodeAndCheck(is); |
| 1116 | } |
| 1117 | |
| 1118 | BerLength length = new BerLength(); |
| 1119 | codeLength += length.decode(is); |
| 1120 | |
| 1121 | int totalLength = length.val; |
| 1122 | codeLength += totalLength; |
| 1123 | |
| 1124 | subCodeLength += berTag.decode(is); |
| 1125 | if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) { |
| 1126 | pciArfcn = new PCIARFCN(); |
| 1127 | subCodeLength += pciArfcn.decode(is, false); |
| 1128 | subCodeLength += berTag.decode(is); |
| 1129 | } |
| 1130 | else { |
| 1131 | throw new IOException("Tag does not match the mandatory sequence element tag."); |
| 1132 | } |
| 1133 | |
| 1134 | if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) { |
| 1135 | qciVals = new QciVals(); |
| 1136 | subCodeLength += qciVals.decode(is, false); |
| 1137 | subCodeLength += berTag.decode(is); |
| 1138 | } |
| 1139 | else { |
| 1140 | throw new IOException("Tag does not match the mandatory sequence element tag."); |
| 1141 | } |
| 1142 | |
| 1143 | if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) { |
| 1144 | prbUsage = new PRBUsage(); |
| 1145 | subCodeLength += prbUsage.decode(is, false); |
| 1146 | subCodeLength += berTag.decode(is); |
| 1147 | } |
| 1148 | else { |
| 1149 | throw new IOException("Tag does not match the mandatory sequence element tag."); |
| 1150 | } |
| 1151 | |
| 1152 | if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) { |
| 1153 | mcsDl = new McsDl(); |
| 1154 | subCodeLength += mcsDl.decode(is, false); |
| 1155 | subCodeLength += berTag.decode(is); |
| 1156 | } |
| 1157 | else { |
| 1158 | throw new IOException("Tag does not match the mandatory sequence element tag."); |
| 1159 | } |
| 1160 | |
| 1161 | if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) { |
| 1162 | numSchedTtisDl = new NumSchedTtisDl(); |
| 1163 | subCodeLength += numSchedTtisDl.decode(is, false); |
| 1164 | subCodeLength += berTag.decode(is); |
| 1165 | } |
| 1166 | else { |
| 1167 | throw new IOException("Tag does not match the mandatory sequence element tag."); |
| 1168 | } |
| 1169 | |
| 1170 | if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) { |
| 1171 | mcsUl = new McsUl(); |
| 1172 | subCodeLength += mcsUl.decode(is, false); |
| 1173 | subCodeLength += berTag.decode(is); |
| 1174 | } |
| 1175 | else { |
| 1176 | throw new IOException("Tag does not match the mandatory sequence element tag."); |
| 1177 | } |
| 1178 | |
| 1179 | if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) { |
| 1180 | numSchedTtisUl = new NumSchedTtisUl(); |
| 1181 | subCodeLength += numSchedTtisUl.decode(is, false); |
| 1182 | subCodeLength += berTag.decode(is); |
| 1183 | } |
| 1184 | else { |
| 1185 | throw new IOException("Tag does not match the mandatory sequence element tag."); |
| 1186 | } |
| 1187 | |
| 1188 | if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 7)) { |
| 1189 | rankDl1 = new RankDl1(); |
| 1190 | subCodeLength += rankDl1.decode(is, false); |
| 1191 | subCodeLength += berTag.decode(is); |
| 1192 | } |
| 1193 | else { |
| 1194 | throw new IOException("Tag does not match the mandatory sequence element tag."); |
| 1195 | } |
| 1196 | |
| 1197 | if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) { |
| 1198 | rankDl2 = new RankDl2(); |
| 1199 | subCodeLength += rankDl2.decode(is, false); |
| 1200 | if (subCodeLength == totalLength) { |
| 1201 | return codeLength; |
| 1202 | } |
| 1203 | } |
| 1204 | throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength); |
| 1205 | |
| 1206 | |
| 1207 | } |
| 1208 | |
| 1209 | public void encodeAndSave(int encodingSizeGuess) throws IOException { |
| 1210 | BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess); |
| 1211 | encode(os, false); |
| 1212 | code = os.getArray(); |
| 1213 | } |
| 1214 | |
| 1215 | public String toString() { |
| 1216 | StringBuilder sb = new StringBuilder(); |
| 1217 | appendAsString(sb, 0); |
| 1218 | return sb.toString(); |
| 1219 | } |
| 1220 | |
| 1221 | public void appendAsString(StringBuilder sb, int indentLevel) { |
| 1222 | |
| 1223 | sb.append("{"); |
| 1224 | sb.append("\n"); |
| 1225 | for (int i = 0; i < indentLevel + 1; i++) { |
| 1226 | sb.append("\t"); |
| 1227 | } |
| 1228 | if (pciArfcn != null) { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 1229 | sb.append("pciArfcn: "); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1230 | pciArfcn.appendAsString(sb, indentLevel + 1); |
| 1231 | } |
| 1232 | |
| 1233 | sb.append(",\n"); |
| 1234 | for (int i = 0; i < indentLevel + 1; i++) { |
| 1235 | sb.append("\t"); |
| 1236 | } |
| 1237 | if (qciVals != null) { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 1238 | sb.append("qciVals: "); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1239 | qciVals.appendAsString(sb, indentLevel + 1); |
| 1240 | } |
| 1241 | |
| 1242 | sb.append(",\n"); |
| 1243 | for (int i = 0; i < indentLevel + 1; i++) { |
| 1244 | sb.append("\t"); |
| 1245 | } |
| 1246 | if (prbUsage != null) { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 1247 | sb.append("prbUsage: "); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1248 | prbUsage.appendAsString(sb, indentLevel + 1); |
| 1249 | } |
| 1250 | |
| 1251 | sb.append(",\n"); |
| 1252 | for (int i = 0; i < indentLevel + 1; i++) { |
| 1253 | sb.append("\t"); |
| 1254 | } |
| 1255 | if (mcsDl != null) { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 1256 | sb.append("mcsDl: "); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1257 | mcsDl.appendAsString(sb, indentLevel + 1); |
| 1258 | } |
| 1259 | |
| 1260 | sb.append(",\n"); |
| 1261 | for (int i = 0; i < indentLevel + 1; i++) { |
| 1262 | sb.append("\t"); |
| 1263 | } |
| 1264 | if (numSchedTtisDl != null) { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 1265 | sb.append("numSchedTtisDl: "); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1266 | numSchedTtisDl.appendAsString(sb, indentLevel + 1); |
| 1267 | } |
| 1268 | |
| 1269 | sb.append(",\n"); |
| 1270 | for (int i = 0; i < indentLevel + 1; i++) { |
| 1271 | sb.append("\t"); |
| 1272 | } |
| 1273 | if (mcsUl != null) { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 1274 | sb.append("mcsUl: "); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1275 | mcsUl.appendAsString(sb, indentLevel + 1); |
| 1276 | } |
| 1277 | |
| 1278 | sb.append(",\n"); |
| 1279 | for (int i = 0; i < indentLevel + 1; i++) { |
| 1280 | sb.append("\t"); |
| 1281 | } |
| 1282 | if (numSchedTtisUl != null) { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 1283 | sb.append("numSchedTtisUl: "); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1284 | numSchedTtisUl.appendAsString(sb, indentLevel + 1); |
| 1285 | } |
| 1286 | |
| 1287 | sb.append(",\n"); |
| 1288 | for (int i = 0; i < indentLevel + 1; i++) { |
| 1289 | sb.append("\t"); |
| 1290 | } |
| 1291 | if (rankDl1 != null) { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 1292 | sb.append("rankDl1: "); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1293 | rankDl1.appendAsString(sb, indentLevel + 1); |
| 1294 | } |
| 1295 | |
| 1296 | sb.append(",\n"); |
| 1297 | for (int i = 0; i < indentLevel + 1; i++) { |
| 1298 | sb.append("\t"); |
| 1299 | } |
| 1300 | if (rankDl2 != null) { |
slowr | 60d4d10 | 2017-08-16 18:33:58 -0700 | [diff] [blame] | 1301 | sb.append("rankDl2: "); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1302 | rankDl2.appendAsString(sb, indentLevel + 1); |
| 1303 | } |
| 1304 | |
| 1305 | sb.append("\n"); |
| 1306 | for (int i = 0; i < indentLevel; i++) { |
| 1307 | sb.append("\t"); |
| 1308 | } |
| 1309 | sb.append("}"); |
| 1310 | } |
| 1311 | |
| 1312 | } |
| 1313 | |