@@ -149,13 +149,13 @@ private static CBORObject ConstructIntegerValue(int v) {
149149 CBORObject .ConstructIntegerValue (0 );
150150
151151 static final int CBORObjectTypeArray = 4 ;
152- static final int CBORObjectTypeBigInteger = 1 ; // all other integers
152+ static final int CBORObjectTypeBigInteger = 1 ; // all other integers
153153 static final int CBORObjectTypeByteString = 2 ;
154154 static final int CBORObjectTypeDouble = 8 ;
155155 static final int CBORObjectTypeExtendedDecimal = 9 ;
156156 static final int CBORObjectTypeExtendedFloat = 11 ;
157157 static final int CBORObjectTypeExtendedRational = 12 ;
158- static final int CBORObjectTypeInteger = 0 ; // -(2^63).. (2^63-1)
158+ static final int CBORObjectTypeInteger = 0 ; // -(2^63).. (2^63-1)
159159 static final int CBORObjectTypeMap = 5 ;
160160 static final int CBORObjectTypeSimpleValue = 6 ;
161161 static final int CBORObjectTypeSingle = 7 ;
@@ -190,21 +190,21 @@ null, new CBORExtendedFloat(), new CBORExtendedRational()
190190 // 0 means length varies. -1 means invalid.
191191 private static final int [] ValueExpectedLengths = { 1 , 1 , 1 , 1 , 1 , 1 ,
192192 1 , 1 , 1 ,
193- 1 , 1 , 1 , 1 , 1 , 1 , 1 , // major type 0
193+ 1 , 1 , 1 , 1 , 1 , 1 , 1 , // major type 0
194194 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 2 , 3 , 5 , 9 , -1 , -1 , -1 , -1 ,
195- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , // major type 1
195+ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , // major type 1
196196 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 2 , 3 , 5 , 9 , -1 , -1 , -1 , -1 ,
197- 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , // major type 2
197+ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , // major type 2
198198 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 0 , 0 , 0 , 0 , -1 , -1 , -1 , 0 ,
199- 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , // major type 3
199+ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , // major type 3
200200 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 0 , 0 , 0 , 0 , -1 , -1 , -1 , 0 ,
201- 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // major type 4
201+ 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // major type 4
202202 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , -1 , -1 , -1 , 0 ,
203- 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // major type 5
203+ 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // major type 5
204204 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , -1 , -1 , -1 , 0 ,
205- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // major type 6
205+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // major type 6
206206 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , -1 , -1 , -1 , -1 ,
207- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , // major type 7
207+ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , // major type 7
208208 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 2 , 3 , 5 , 9 , -1 , -1 , -1 , -1 };
209209
210210 private static final byte [] ValueFalseBytes = { 0x66 , 0x61 , 0x6c ,
@@ -1718,7 +1718,7 @@ public static void Write(String str, OutputStream stream) throws java.io.IOExcep
17181718 throw new NullPointerException ("stream" );
17191719 }
17201720 if (str == null ) {
1721- stream .write (0xf6 ); // Write null instead of String
1721+ stream .write (0xf6 ); // Write null instead of String
17221722 } else {
17231723 // TODO: Maybe change to unstreamed String in 3.0
17241724 WriteStreamedString (str , stream );
@@ -1741,7 +1741,7 @@ public static void Write(
17411741 throw new NullPointerException ("stream" );
17421742 }
17431743 if (str == null ) {
1744- stream .write (0xf6 ); // Write null instead of String
1744+ stream .write (0xf6 ); // Write null instead of String
17451745 } else {
17461746 CBOREncodeOptions noIndef =
17471747 options .And (CBOREncodeOptions .NoIndefLengthStrings );
@@ -1818,13 +1818,13 @@ public static void Write(EFloat bignum, OutputStream stream) throws java.io.IOEx
18181818 Write (bignum .getMantissa (), stream );
18191819 } else {
18201820 if (!BigIntFits (exponent )) {
1821- stream .write (0xd9 ); // tag 265
1821+ stream .write (0xd9 ); // tag 265
18221822 stream .write (0x01 );
18231823 stream .write (0x09 );
1824- stream .write (0x82 ); // array, length 2
1824+ stream .write (0x82 ); // array, length 2
18251825 } else {
1826- stream .write (0xc5 ); // tag 5
1827- stream .write (0x82 ); // array, length 2
1826+ stream .write (0xc5 ); // tag 5
1827+ stream .write (0x82 ); // array, length 2
18281828 }
18291829 Write (bignum .getExponent (), stream );
18301830 Write (bignum .getMantissa (), stream );
@@ -1874,9 +1874,9 @@ public static void Write(ERational rational, OutputStream stream) throws java.io
18741874 Write (rational .getNumerator (), stream );
18751875 return ;
18761876 }
1877- stream .write (0xd8 ); // tag 30
1877+ stream .write (0xd8 ); // tag 30
18781878 stream .write (0x1e );
1879- stream .write (0x82 ); // array, length 2
1879+ stream .write (0x82 ); // array, length 2
18801880 Write (rational .getNumerator (), stream );
18811881 Write (rational .getDenominator (), stream );
18821882 }
@@ -1942,13 +1942,13 @@ public static void Write(EDecimal bignum, OutputStream stream) throws java.io.IO
19421942 Write (bignum .getMantissa (), stream );
19431943 } else {
19441944 if (!BigIntFits (exponent )) {
1945- stream .write (0xd9 ); // tag 264
1945+ stream .write (0xd9 ); // tag 264
19461946 stream .write (0x01 );
19471947 stream .write (0x08 );
1948- stream .write (0x82 ); // array, length 2
1948+ stream .write (0x82 ); // array, length 2
19491949 } else {
1950- stream .write (0xc4 ); // tag 4
1951- stream .write (0x82 ); // array, length 2
1950+ stream .write (0xc4 ); // tag 4
1951+ stream .write (0x82 ); // array, length 2
19521952 }
19531953 Write (bignum .getExponent (), stream );
19541954 Write (bignum .getMantissa (), stream );
@@ -2087,7 +2087,7 @@ public static void Write(long value, OutputStream stream) throws java.io.IOExcep
20872087 WritePositiveInt64 (0 , value , stream );
20882088 } else {
20892089 ++value ;
2090- value = -value ; // Will never overflow
2090+ value = -value ; // Will never overflow
20912091 WritePositiveInt64 (1 , value , stream );
20922092 }
20932093 }
@@ -2796,31 +2796,31 @@ public int compareTo(CBORObject other) {
27962796 int simpleValueA = -1 ;
27972797 int simpleValueB = -1 ;
27982798 if (typeA == CBORObjectTypeSimpleValue ) {
2799- if (((Integer )objA ).intValue () == 20 ) { // false
2799+ if (((Integer )objA ).intValue () == 20 ) { // false
28002800 simpleValueA = 2 ;
2801- } else if (((Integer )objA ).intValue () == 21 ) { // true
2801+ } else if (((Integer )objA ).intValue () == 21 ) { // true
28022802 simpleValueA = 3 ;
2803- } else if (((Integer )objA ).intValue () == 22 ) { // null
2803+ } else if (((Integer )objA ).intValue () == 22 ) { // null
28042804 simpleValueA = 1 ;
2805- } else if (((Integer )objA ).intValue () == 23 ) { // undefined
2805+ } else if (((Integer )objA ).intValue () == 23 ) { // undefined
28062806 simpleValueA = 0 ;
28072807 }
28082808 }
28092809 if (typeB == CBORObjectTypeSimpleValue ) {
2810- if (((Integer )objB ).intValue () == 20 ) { // false
2810+ if (((Integer )objB ).intValue () == 20 ) { // false
28112811 simpleValueB = 2 ;
2812- } else if (((Integer )objB ).intValue () == 21 ) { // true
2812+ } else if (((Integer )objB ).intValue () == 21 ) { // true
28132813 simpleValueB = 3 ;
2814- } else if (((Integer )objB ).intValue () == 22 ) { // null
2814+ } else if (((Integer )objB ).intValue () == 22 ) { // null
28152815 simpleValueB = 1 ;
2816- } else if (((Integer )objB ).intValue () == 23 ) { // undefined
2816+ } else if (((Integer )objB ).intValue () == 23 ) { // undefined
28172817 simpleValueB = 0 ;
28182818 }
28192819 }
28202820 int cmp = 0 ;
28212821 if (simpleValueA >= 0 || simpleValueB >= 0 ) {
28222822 if (simpleValueB < 0 ) {
2823- return -1 ; // B is not true, false, null, or undefined, so A is less
2823+ return -1 ; // B is not true, false, null, or undefined, so A is less
28242824 }
28252825 if (simpleValueA < 0 ) {
28262826 return 1 ;
@@ -3122,7 +3122,7 @@ public byte[] EncodeToBytes(CBOREncodeOptions options) {
31223122 intBytes = GetPositiveInt64Bytes (0 , value );
31233123 } else {
31243124 ++value ;
3125- value = -value ; // Will never overflow
3125+ value = -value ; // Will never overflow
31263126 intBytes = GetPositiveInt64Bytes (1 , value );
31273127 }
31283128 if (!tagged ) {
@@ -4099,12 +4099,12 @@ static CBORObject GetFixedLengthObject(
40994099 default : throw new CBORException ("Unexpected data encountered" );
41004100 }
41014101 }
4102- if (majortype == 2 ) { // short byte String
4102+ if (majortype == 2 ) { // short byte String
41034103 byte [] ret = new byte [firstbyte - 0x40 ];
41044104 System .arraycopy (data , 1 , ret , 0 , firstbyte - 0x40 );
41054105 return new CBORObject (CBORObjectTypeByteString , ret );
41064106 }
4107- if (majortype == 3 ) { // short text String
4107+ if (majortype == 3 ) { // short text String
41084108 StringBuilder ret = new StringBuilder (firstbyte - 0x60 );
41094109 DataUtilities .ReadUtf8FromBytes (data , 1 , firstbyte - 0x60 , ret , false );
41104110 return new CBORObject (CBORObjectTypeTextString , ret .toString ());
0 commit comments