diff options
author | John Doe <john.doe@example.com> | 2021-07-21 12:34:35 +0200 |
---|---|---|
committer | John Doe <john.doe@example.com> | 2021-07-21 12:34:35 +0200 |
commit | 71bd11c7468e1cbccc58069e70c176c67fb8de53 (patch) | |
tree | 528a98796cd304b4d9f1b81e23d47cf9c465cee9 /src/main/java/org/uic/barcode/asn1/uper/Document2.txt | |
parent | Update uicRailTicketData_v3.0.0.asn (diff) | |
download | UIC-barcode-71bd11c7468e1cbccc58069e70c176c67fb8de53.tar UIC-barcode-71bd11c7468e1cbccc58069e70c176c67fb8de53.tar.gz UIC-barcode-71bd11c7468e1cbccc58069e70c176c67fb8de53.tar.bz2 UIC-barcode-71bd11c7468e1cbccc58069e70c176c67fb8de53.tar.lz UIC-barcode-71bd11c7468e1cbccc58069e70c176c67fb8de53.tar.xz UIC-barcode-71bd11c7468e1cbccc58069e70c176c67fb8de53.tar.zst UIC-barcode-71bd11c7468e1cbccc58069e70c176c67fb8de53.zip |
Diffstat (limited to 'src/main/java/org/uic/barcode/asn1/uper/Document2.txt')
-rw-r--r-- | src/main/java/org/uic/barcode/asn1/uper/Document2.txt | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/main/java/org/uic/barcode/asn1/uper/Document2.txt b/src/main/java/org/uic/barcode/asn1/uper/Document2.txt deleted file mode 100644 index 176ec23..0000000 --- a/src/main/java/org/uic/barcode/asn1/uper/Document2.txt +++ /dev/null @@ -1,34 +0,0 @@ - if (restrictionAnnotation.value() == CharacterRestriction.UTF8String) {
- // UTF8 length
- BitBuffer stringbuffer = ByteBitBuffer.createInfinite();
-
- //char array replaced - begin
- byte[] stringasbytearray = string.getBytes(StandardCharsets.UTF_8);
-
- for (byte b: stringasbytearray){
- UperEncoder.encodeConstrainedInt(stringbuffer, byte & 0xff, 0, 255);
- }
- //char array replaced - end
-
- stringbuffer.flip();
- if (stringbuffer.limit() % 8 != 0) {
- throw new AssertionError("utf8 encoding resulted not in multiple of 8 bits");
- }
- int numOctets = (stringbuffer.limit() + 7) / 8; // Actually +7 is not needed here,
- // since we already checked with %8.
- int position1 = bitbuffer.position();
- UperEncoder.encodeLengthDeterminant(bitbuffer, numOctets);
- UperEncoder.logger.debug(String.format("UTF8String %s, length %d octets, encoded as %s", string, numOctets, bitbuffer.toBooleanStringFromPosition(position1)));
- int position2 = bitbuffer.position();
- for (int i = 0; i < stringbuffer.limit(); i++) {
- bitbuffer.put(stringbuffer.get());
- }
- UperEncoder.logger.debug(String.format("UTF8String %s, encoded length %d octets, value bits: %s", string, numOctets, bitbuffer.toBooleanStringFromPosition(position2)));
- return;
-
-
-
-
-
-
-new String(bytearray, StandardCharsets.UTF_8));
\ No newline at end of file |