@@ -1841,8 +1841,7 @@ private long CalcEncodedSize(int depth) {
18411841 return size + 1 ;
18421842 case SimpleValue :
18431843 return size + (cbor .getSimpleValue () >= 24 ? 2 : 1 );
1844- default :
1845- throw new IllegalStateException ();
1844+ default : throw new IllegalStateException ();
18461845 }
18471846 }
18481847
@@ -2089,9 +2088,8 @@ public static CBORObject FromString(String strValue) {
20892088 "surrogate code point." );
20902089}
20912090 return new CBORObject (
2092- strValue .length () == utf8Length ? CBORObjectTypeTextStringAscii :
2093- CBORObjectTypeTextString ,
2094- strValue );
2091+ strValue .length () == utf8Length ? CBORObjectTypeTextStringAscii : CBORObjectTypeTextString ,
2092+ strValue );
20952093 }
20962094
20972095 /**
@@ -3688,8 +3686,7 @@ public static void Write(EInteger bigint, OutputStream stream) throws java.io.IO
36883686 stream .write ((byte )((datatype << 5 ) | 27 ));
36893687 stream .write (bytes , 0 , byteCount );
36903688 break ;
3691- default :
3692- stream .write ((datatype == 0 ) ?
3689+ default : stream .write ((datatype == 0 ) ?
36933690 (byte )0xc2 : (byte )0xc3 );
36943691 WritePositiveInt (2 , byteCount , stream );
36953692 stream .write (bytes , 0 , byteCount );
@@ -4173,8 +4170,7 @@ public long AsInt64Value() {
41734170 EInteger ei = (EInteger )this .getThisItem ();
41744171 return ei .ToInt64Checked ();
41754172 }
4176- default :
4177- throw new IllegalStateException ("Not an integer type" );
4173+ default : throw new IllegalStateException ("Not an integer type" );
41784174 }
41794175 }
41804176
@@ -4194,8 +4190,7 @@ public boolean CanValueFitInInt64() {
41944190 EInteger ei = (EInteger )this .getThisItem ();
41954191 return ei .CanFitInInt64 ();
41964192 }
4197- default :
4198- return false ;
4193+ default : return false ;
41994194 }
42004195 }
42014196
@@ -4237,8 +4232,7 @@ public EInteger AsEIntegerValue() {
42374232 return EInteger .FromInt64 ((((Long )this .getThisItem ()).longValue ()));
42384233 case CBORObjectTypeEInteger :
42394234 return (EInteger )this .getThisItem ();
4240- default :
4241- throw new IllegalStateException ("Not an integer type" );
4235+ default : throw new IllegalStateException ("Not an integer type" );
42424236 }
42434237 }
42444238
@@ -4260,8 +4254,7 @@ public long AsDoubleBits() {
42604254 switch (this .getType ()) {
42614255 case FloatingPoint :
42624256 return ((Long )this .getThisItem ()).longValue ();
4263- default :
4264- throw new IllegalStateException ("Not a floating-point" +
4257+ default : throw new IllegalStateException ("Not a floating-point" +
42654258 "\u0020 type" );
42664259 }
42674260 }
@@ -4278,8 +4271,7 @@ public double AsDoubleValue() {
42784271 switch (this .getType ()) {
42794272 case FloatingPoint :
42804273 return CBORUtilities .Int64BitsToDouble ((((Long )this .getThisItem ()).longValue ()));
4281- default :
4282- throw new IllegalStateException ("Not a floating-point" +
4274+ default : throw new IllegalStateException ("Not a floating-point" +
42834275 "\u0020 type" );
42844276 }
42854277 }
@@ -4512,8 +4504,7 @@ public int compareTo(CBORObject other) {
45124504 GetDoubleBytes (other .AsDoubleBits (), 0 ));
45134505 break ;
45144506 }
4515- default :
4516- throw new IllegalStateException ("Unexpected data " +
4507+ default : throw new IllegalStateException ("Unexpected data " +
45174508 "type" );
45184509 }
45194510 } else if ((typeB == CBORObjectTypeInteger && typeA ==
@@ -4628,11 +4619,11 @@ private static byte[] GetDoubleBytes64(long valueBits, int tagbyte) {
46284619 (byte )((valueBits >> 24 ) & 0xff ), (byte )((valueBits >> 16 ) & 0xff ),
46294620 (byte )((valueBits >> 8 ) & 0xff ), (byte )(valueBits & 0xff ),
46304621 } : new byte [] { (byte )0xfb , (byte )((valueBits >> 56 ) & 0xff ),
4631- (byte )((valueBits >> 48 ) & 0xff ), (byte )((valueBits >> 40 ) & 0xff ),
4632- (byte )((valueBits >> 32 ) & 0xff ), (byte )((valueBits >> 24 ) & 0xff ),
4633- (byte )((valueBits >> 16 ) & 0xff ), (byte )((valueBits >> 8 ) & 0xff ),
4634- (byte )(valueBits & 0xff ),
4635- };
4622+ (byte )((valueBits >> 48 ) & 0xff ), (byte )((valueBits >> 40 ) & 0xff ),
4623+ (byte )((valueBits >> 32 ) & 0xff ), (byte )((valueBits >> 24 ) & 0xff ),
4624+ (byte )((valueBits >> 16 ) & 0xff ), (byte )((valueBits >> 8 ) & 0xff ),
4625+ (byte )(valueBits & 0xff ),
4626+ };
46364627 }
46374628
46384629 private static byte [] GetDoubleBytes (long valueBits , int tagbyte ) {
@@ -4641,18 +4632,18 @@ private static byte[] GetDoubleBytes(long valueBits, int tagbyte) {
46414632 return tagbyte != 0 ? new byte [] { (byte )tagbyte , (byte )0xf9 ,
46424633 (byte )((bits >> 8 ) & 0xff ), (byte )(bits & 0xff ),
46434634 } : new byte [] { (byte )0xf9 , (byte )((bits >> 8 ) & 0xff ),
4644- (byte )(bits & 0xff ),
4645- };
4635+ (byte )(bits & 0xff ),
4636+ };
46464637 }
46474638 if (CBORUtilities .DoubleRetainsSameValueInSingle (valueBits )) {
46484639 bits = CBORUtilities .DoubleToRoundedSinglePrecision (valueBits );
46494640 return tagbyte != 0 ? new byte [] { (byte )tagbyte , (byte )0xfa ,
46504641 (byte )((bits >> 24 ) & 0xff ), (byte )((bits >> 16 ) & 0xff ),
46514642 (byte )((bits >> 8 ) & 0xff ), (byte )(bits & 0xff ),
46524643 } : new byte [] { (byte )0xfa , (byte )((bits >> 24 ) & 0xff ),
4653- (byte )((bits >> 16 ) & 0xff ), (byte )((bits >> 8 ) & 0xff ),
4654- (byte )(bits & 0xff ),
4655- };
4644+ (byte )((bits >> 16 ) & 0xff ), (byte )((bits >> 8 ) & 0xff ),
4645+ (byte )(bits & 0xff ),
4646+ };
46564647 }
46574648 return GetDoubleBytes64 (valueBits , tagbyte );
46584649 }
@@ -4953,8 +4944,7 @@ public boolean equals(CBORObject other) {
49534944 (((this .itemValue ) == null ) ? ((otherValue .itemValue ) == null ) : (this .itemValue ).equals (otherValue .itemValue ));
49544945 case CBORObjectTypeDouble :
49554946 return this .AsDoubleBits () == otherValue .AsDoubleBits ();
4956- default :
4957- return ((this .itemValue ) == null ) ? ((otherValue .itemValue ) == null ) : (this .itemValue ).equals (otherValue .itemValue );
4947+ default : return ((this .itemValue ) == null ) ? ((otherValue .itemValue ) == null ) : (this .itemValue ).equals (otherValue .itemValue );
49584948 }
49594949 }
49604950
@@ -5790,8 +5780,7 @@ public static CBORObject FromFloatingPointBits(
57905780 return new CBORObject (CBORObjectTypeDouble , value );
57915781 case 8 :
57925782 return new CBORObject (CBORObjectTypeDouble , floatingBits );
5793- default :
5794- throw new IllegalArgumentException ("byteCount" );
5783+ default : throw new IllegalArgumentException ("byteCount" );
57955784 }
57965785 }
57975786
@@ -5951,8 +5940,7 @@ public static int WriteFloatingPointValue(
59515940 case 8 :
59525941 bits = CBORUtilities .DoubleToInt64Bits (doubleVal );
59535942 return WriteFloatingPointBits (outputStream , bits , 8 );
5954- default :
5955- throw new IllegalArgumentException ("byteCount" );
5943+ default : throw new IllegalArgumentException ("byteCount" );
59565944 }
59575945 }
59585946
@@ -5995,8 +5983,7 @@ public static int WriteFloatingPointValue(
59955983 bits = Float .floatToRawIntBits (singleVal );
59965984 longbits = CBORUtilities .SingleToDoublePrecision (bits );
59975985 return WriteFloatingPointBits (outputStream , longbits , 8 );
5998- default :
5999- throw new IllegalArgumentException ("byteCount" );
5986+ default : throw new IllegalArgumentException ("byteCount" );
60005987 }
60015988 }
60025989
@@ -6522,8 +6509,7 @@ static CBORObject GetFixedLengthObject(
65226509 (int )uadditional );
65236510 }
65246511 throw new CBORException ("Unexpected data encountered" );
6525- default :
6526- throw new CBORException ("Unexpected data encountered" );
6512+ default : throw new CBORException ("Unexpected data encountered" );
65276513 }
65286514 }
65296515 if (majortype == 2 ) { // short byte String
@@ -6804,16 +6790,16 @@ private static byte[] GetPositiveInt64Bytes(int type, long value) {
68046790 return value < 24 ? new byte [] { (byte )((byte )value | (byte )(type << 5 )) } :
68056791 value <= 0xffL ? new byte [] { (byte )(24 | (type << 5 )), (byte )(value & 0xff ),
68066792 } : value <= 0xffffL ? new byte [] { (byte )(25 | (type << 5 )),
6807- (byte )((value >> 8 ) & 0xff ), (byte )(value & 0xff ),
6808- } : value <= 0xffffffffL ? new byte [] { (byte )(26 | (type << 5 )),
6809- (byte )((value >> 24 ) & 0xff ), (byte )((value >> 16 ) & 0xff ),
6810- (byte )((value >> 8 ) & 0xff ), (byte )(value & 0xff ),
6811- } : new byte [] { (byte )(27 | (type << 5 )), (byte )((value >> 56 ) & 0xff ),
6812- (byte )((value >> 48 ) & 0xff ), (byte )((value >> 40 ) & 0xff ),
6813- (byte )((value >> 32 ) & 0xff ), (byte )((value >> 24 ) & 0xff ),
6814- (byte )((value >> 16 ) & 0xff ), (byte )((value >> 8 ) & 0xff ),
6815- (byte )(value & 0xff ),
6816- };
6793+ (byte )((value >> 8 ) & 0xff ), (byte )(value & 0xff ),
6794+ } : value <= 0xffffffffL ? new byte [] { (byte )(26 | (type << 5 )),
6795+ (byte )((value >> 24 ) & 0xff ), (byte )((value >> 16 ) & 0xff ),
6796+ (byte )((value >> 8 ) & 0xff ), (byte )(value & 0xff ),
6797+ } : new byte [] { (byte )(27 | (type << 5 )), (byte )((value >> 56 ) & 0xff ),
6798+ (byte )((value >> 48 ) & 0xff ), (byte )((value >> 40 ) & 0xff ),
6799+ (byte )((value >> 32 ) & 0xff ), (byte )((value >> 24 ) & 0xff ),
6800+ (byte )((value >> 16 ) & 0xff ), (byte )((value >> 8 ) & 0xff ),
6801+ (byte )(value & 0xff ),
6802+ };
68176803 }
68186804
68196805 private static byte [] GetPositiveIntBytes (int type , int value ) {
@@ -6824,11 +6810,11 @@ private static byte[] GetPositiveIntBytes(int type, int value) {
68246810 return value < 24 ? new byte [] { (byte )((byte )value | (byte )(type << 5 )) } :
68256811 value <= 0xff ? new byte [] { (byte )(24 | (type << 5 )), (byte )(value & 0xff ),
68266812 } : value <= 0xffff ? new byte [] { (byte )(25 | (type << 5 )),
6827- (byte )((value >> 8 ) & 0xff ), (byte )(value & 0xff ),
6828- } : new byte [] { (byte )(26 | (type << 5 )), (byte )((value >> 24 ) & 0xff ),
6829- (byte )((value >> 16 ) & 0xff ), (byte )((value >> 8 ) & 0xff ),
6830- (byte )(value & 0xff ),
6831- };
6813+ (byte )((value >> 8 ) & 0xff ), (byte )(value & 0xff ),
6814+ } : new byte [] { (byte )(26 | (type << 5 )), (byte )((value >> 24 ) & 0xff ),
6815+ (byte )((value >> 16 ) & 0xff ), (byte )((value >> 8 ) & 0xff ),
6816+ (byte )(value & 0xff ),
6817+ };
68326818 }
68336819
68346820 // Initialize fixed values for certain
0 commit comments