@@ -1841,8 +1841,7 @@ private long CalcEncodedSize(int depth) {
1841
1841
return size + 1 ;
1842
1842
case SimpleValue :
1843
1843
return size + (cbor .getSimpleValue () >= 24 ? 2 : 1 );
1844
- default :
1845
- throw new IllegalStateException ();
1844
+ default : throw new IllegalStateException ();
1846
1845
}
1847
1846
}
1848
1847
@@ -2089,9 +2088,8 @@ public static CBORObject FromString(String strValue) {
2089
2088
"surrogate code point." );
2090
2089
}
2091
2090
return new CBORObject (
2092
- strValue .length () == utf8Length ? CBORObjectTypeTextStringAscii :
2093
- CBORObjectTypeTextString ,
2094
- strValue );
2091
+ strValue .length () == utf8Length ? CBORObjectTypeTextStringAscii : CBORObjectTypeTextString ,
2092
+ strValue );
2095
2093
}
2096
2094
2097
2095
/**
@@ -3688,8 +3686,7 @@ public static void Write(EInteger bigint, OutputStream stream) throws java.io.IO
3688
3686
stream .write ((byte )((datatype << 5 ) | 27 ));
3689
3687
stream .write (bytes , 0 , byteCount );
3690
3688
break ;
3691
- default :
3692
- stream .write ((datatype == 0 ) ?
3689
+ default : stream .write ((datatype == 0 ) ?
3693
3690
(byte )0xc2 : (byte )0xc3 );
3694
3691
WritePositiveInt (2 , byteCount , stream );
3695
3692
stream .write (bytes , 0 , byteCount );
@@ -4173,8 +4170,7 @@ public long AsInt64Value() {
4173
4170
EInteger ei = (EInteger )this .getThisItem ();
4174
4171
return ei .ToInt64Checked ();
4175
4172
}
4176
- default :
4177
- throw new IllegalStateException ("Not an integer type" );
4173
+ default : throw new IllegalStateException ("Not an integer type" );
4178
4174
}
4179
4175
}
4180
4176
@@ -4194,8 +4190,7 @@ public boolean CanValueFitInInt64() {
4194
4190
EInteger ei = (EInteger )this .getThisItem ();
4195
4191
return ei .CanFitInInt64 ();
4196
4192
}
4197
- default :
4198
- return false ;
4193
+ default : return false ;
4199
4194
}
4200
4195
}
4201
4196
@@ -4237,8 +4232,7 @@ public EInteger AsEIntegerValue() {
4237
4232
return EInteger .FromInt64 ((((Long )this .getThisItem ()).longValue ()));
4238
4233
case CBORObjectTypeEInteger :
4239
4234
return (EInteger )this .getThisItem ();
4240
- default :
4241
- throw new IllegalStateException ("Not an integer type" );
4235
+ default : throw new IllegalStateException ("Not an integer type" );
4242
4236
}
4243
4237
}
4244
4238
@@ -4260,8 +4254,7 @@ public long AsDoubleBits() {
4260
4254
switch (this .getType ()) {
4261
4255
case FloatingPoint :
4262
4256
return ((Long )this .getThisItem ()).longValue ();
4263
- default :
4264
- throw new IllegalStateException ("Not a floating-point" +
4257
+ default : throw new IllegalStateException ("Not a floating-point" +
4265
4258
"\u0020 type" );
4266
4259
}
4267
4260
}
@@ -4278,8 +4271,7 @@ public double AsDoubleValue() {
4278
4271
switch (this .getType ()) {
4279
4272
case FloatingPoint :
4280
4273
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" +
4283
4275
"\u0020 type" );
4284
4276
}
4285
4277
}
@@ -4512,8 +4504,7 @@ public int compareTo(CBORObject other) {
4512
4504
GetDoubleBytes (other .AsDoubleBits (), 0 ));
4513
4505
break ;
4514
4506
}
4515
- default :
4516
- throw new IllegalStateException ("Unexpected data " +
4507
+ default : throw new IllegalStateException ("Unexpected data " +
4517
4508
"type" );
4518
4509
}
4519
4510
} else if ((typeB == CBORObjectTypeInteger && typeA ==
@@ -4628,11 +4619,11 @@ private static byte[] GetDoubleBytes64(long valueBits, int tagbyte) {
4628
4619
(byte )((valueBits >> 24 ) & 0xff ), (byte )((valueBits >> 16 ) & 0xff ),
4629
4620
(byte )((valueBits >> 8 ) & 0xff ), (byte )(valueBits & 0xff ),
4630
4621
} : 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
+ };
4636
4627
}
4637
4628
4638
4629
private static byte [] GetDoubleBytes (long valueBits , int tagbyte ) {
@@ -4641,18 +4632,18 @@ private static byte[] GetDoubleBytes(long valueBits, int tagbyte) {
4641
4632
return tagbyte != 0 ? new byte [] { (byte )tagbyte , (byte )0xf9 ,
4642
4633
(byte )((bits >> 8 ) & 0xff ), (byte )(bits & 0xff ),
4643
4634
} : new byte [] { (byte )0xf9 , (byte )((bits >> 8 ) & 0xff ),
4644
- (byte )(bits & 0xff ),
4645
- };
4635
+ (byte )(bits & 0xff ),
4636
+ };
4646
4637
}
4647
4638
if (CBORUtilities .DoubleRetainsSameValueInSingle (valueBits )) {
4648
4639
bits = CBORUtilities .DoubleToRoundedSinglePrecision (valueBits );
4649
4640
return tagbyte != 0 ? new byte [] { (byte )tagbyte , (byte )0xfa ,
4650
4641
(byte )((bits >> 24 ) & 0xff ), (byte )((bits >> 16 ) & 0xff ),
4651
4642
(byte )((bits >> 8 ) & 0xff ), (byte )(bits & 0xff ),
4652
4643
} : 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
+ };
4656
4647
}
4657
4648
return GetDoubleBytes64 (valueBits , tagbyte );
4658
4649
}
@@ -4953,8 +4944,7 @@ public boolean equals(CBORObject other) {
4953
4944
(((this .itemValue ) == null ) ? ((otherValue .itemValue ) == null ) : (this .itemValue ).equals (otherValue .itemValue ));
4954
4945
case CBORObjectTypeDouble :
4955
4946
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 );
4958
4948
}
4959
4949
}
4960
4950
@@ -5790,8 +5780,7 @@ public static CBORObject FromFloatingPointBits(
5790
5780
return new CBORObject (CBORObjectTypeDouble , value );
5791
5781
case 8 :
5792
5782
return new CBORObject (CBORObjectTypeDouble , floatingBits );
5793
- default :
5794
- throw new IllegalArgumentException ("byteCount" );
5783
+ default : throw new IllegalArgumentException ("byteCount" );
5795
5784
}
5796
5785
}
5797
5786
@@ -5951,8 +5940,7 @@ public static int WriteFloatingPointValue(
5951
5940
case 8 :
5952
5941
bits = CBORUtilities .DoubleToInt64Bits (doubleVal );
5953
5942
return WriteFloatingPointBits (outputStream , bits , 8 );
5954
- default :
5955
- throw new IllegalArgumentException ("byteCount" );
5943
+ default : throw new IllegalArgumentException ("byteCount" );
5956
5944
}
5957
5945
}
5958
5946
@@ -5995,8 +5983,7 @@ public static int WriteFloatingPointValue(
5995
5983
bits = Float .floatToRawIntBits (singleVal );
5996
5984
longbits = CBORUtilities .SingleToDoublePrecision (bits );
5997
5985
return WriteFloatingPointBits (outputStream , longbits , 8 );
5998
- default :
5999
- throw new IllegalArgumentException ("byteCount" );
5986
+ default : throw new IllegalArgumentException ("byteCount" );
6000
5987
}
6001
5988
}
6002
5989
@@ -6522,8 +6509,7 @@ static CBORObject GetFixedLengthObject(
6522
6509
(int )uadditional );
6523
6510
}
6524
6511
throw new CBORException ("Unexpected data encountered" );
6525
- default :
6526
- throw new CBORException ("Unexpected data encountered" );
6512
+ default : throw new CBORException ("Unexpected data encountered" );
6527
6513
}
6528
6514
}
6529
6515
if (majortype == 2 ) { // short byte String
@@ -6804,16 +6790,16 @@ private static byte[] GetPositiveInt64Bytes(int type, long value) {
6804
6790
return value < 24 ? new byte [] { (byte )((byte )value | (byte )(type << 5 )) } :
6805
6791
value <= 0xffL ? new byte [] { (byte )(24 | (type << 5 )), (byte )(value & 0xff ),
6806
6792
} : 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
+ };
6817
6803
}
6818
6804
6819
6805
private static byte [] GetPositiveIntBytes (int type , int value ) {
@@ -6824,11 +6810,11 @@ private static byte[] GetPositiveIntBytes(int type, int value) {
6824
6810
return value < 24 ? new byte [] { (byte )((byte )value | (byte )(type << 5 )) } :
6825
6811
value <= 0xff ? new byte [] { (byte )(24 | (type << 5 )), (byte )(value & 0xff ),
6826
6812
} : 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
+ };
6832
6818
}
6833
6819
6834
6820
// Initialize fixed values for certain
0 commit comments