Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/jcl/src/openj9.dataaccess/share/classes/com/ibm/dataaccess/ByteArrayUnmarshaller.java
12558 views
1
/*[INCLUDE-IF DAA]*/
2
/*******************************************************************************
3
* Copyright (c) 2013, 2020 IBM Corp. and others
4
*
5
* This program and the accompanying materials are made available under
6
* the terms of the Eclipse Public License 2.0 which accompanies this
7
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
* or the Apache License, Version 2.0 which accompanies this distribution and
9
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10
*
11
* This Source Code may also be made available under the following
12
* Secondary Licenses when the conditions for such availability set
13
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
* General Public License, version 2 with the GNU Classpath
15
* Exception [1] and GNU General Public License, version 2 with the
16
* OpenJDK Assembly Exception [2].
17
*
18
* [1] https://www.gnu.org/software/classpath/license.html
19
* [2] http://openjdk.java.net/legal/assembly-exception.html
20
*
21
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
22
*******************************************************************************/
23
package com.ibm.dataaccess;
24
25
/**
26
* Conversion routines to unmarshall Java binary types (short, int, long, float,
27
* double) from byte arrays.
28
*
29
* <p>
30
* With sign extensions enabled, the marshalled data is interpreted as signed
31
* and the data will be appropriately converted into the return type container.
32
* With sign extensions disabled, unfilled bits in the container will be set to
33
* zero. For example, <code>-1</code> as one signed byte is <code>0xFF</code>.
34
* Using <code>readShort</code> with <code>signExtend</code> true, the resultant
35
* short will contain <code>0xFFFF</code>, which is <code>-1</code> in Java's
36
* signed format. With <code>signExtend</code> false, the resultant short will
37
* contain <code>0x00FF</code>, which is <code>255</code>.
38
* </p>
39
*
40
* @author IBM
41
* @version $Revision$ on $Date$
42
*/
43
public final class ByteArrayUnmarshaller {
44
45
// private constructor, class contains only static methods.
46
private ByteArrayUnmarshaller() {
47
super();
48
}
49
50
/**
51
* Returns a short value copied from two consecutive bytes of the byte array
52
* starting at the offset.
53
*
54
* @param byteArray
55
* source
56
* @param offset
57
* offset in the byte array
58
* @param bigEndian
59
* if false the bytes will be copied in reverse (little endian)
60
* order
61
*
62
* @return short
63
*
64
* @throws NullPointerException
65
* if <code>byteArray</code> is null
66
* @throws ArrayIndexOutOfBoundsException
67
* if an invalid array access occurs
68
*/
69
public static short readShort(byte[] byteArray, int offset,
70
boolean bigEndian) {
71
if ((offset + 2 > byteArray.length) || (offset < 0))
72
throw new ArrayIndexOutOfBoundsException("Array access index out of bounds. " +
73
"readShort is trying to access byteArray[" + offset + "] and byteArray[" + (offset + 1) + "], " +
74
" but valid indices are from 0 to " + (byteArray.length - 1) + ".");
75
76
if (bigEndian)
77
return readShort_(byteArray, offset, true);
78
else
79
return readShort_(byteArray, offset, false);
80
}
81
82
private static short readShort_(byte[] byteArray, int offset,
83
boolean bigEndian) {
84
if (bigEndian) {
85
return (short) (((byteArray[offset] & 0xFF) << 8) | ((byteArray[offset + 1] & 0xFF)));
86
} else {
87
return (short) (((byteArray[offset + 1] & 0xFF) << 8) | ((byteArray[offset] & 0xFF)));
88
}
89
}
90
91
/**
92
* Returns a short value copied from zero to two consecutive bytes of the
93
* byte array starting at the offset.
94
*
95
* @param byteArray
96
* source
97
* @param offset
98
* offset in the byte array
99
* @param bigEndian
100
* if false the bytes will be copied in reverse (little endian)
101
* order
102
* @param numBytes
103
* the number of bytes to unmarshall, must be 0-2 inclusive
104
* @param signExtend
105
* if true and <code>numBytes &lt; 2</code> then the topmost
106
* bytes of the returned short will be sign extended
107
*
108
* @return long
109
*
110
* @throws NullPointerException
111
* if <code>byteArray</code> is null
112
* @throws IllegalArgumentException
113
* if <code>numBytes &lt; 0</code> or
114
* <code>numBytes &gt; 2</code>
115
* @throws ArrayIndexOutOfBoundsException
116
* if an invalid array access occurs
117
*/
118
public static short readShort(byte[] byteArray, int offset,
119
boolean bigEndian, int numBytes, boolean signExtend)
120
{
121
if ((offset + numBytes > byteArray.length) || offset < 0)
122
throw new ArrayIndexOutOfBoundsException("Access offset must be positive or zero and last byte must be in range.");
123
if (numBytes < 0 || numBytes > 2)
124
throw new IllegalArgumentException("numBytes == " + numBytes);
125
126
if (bigEndian)
127
{
128
if (signExtend)
129
return readShort_(byteArray, offset, true, numBytes, true);
130
else
131
return readShort_(byteArray, offset, true, numBytes, false);
132
}
133
else
134
{
135
if (signExtend)
136
return readShort_(byteArray, offset, false, numBytes, true);
137
else
138
return readShort_(byteArray, offset, false, numBytes, false);
139
}
140
}
141
142
private static short readShort_(byte[] byteArray, int offset,
143
boolean bigEndian, int numBytes, boolean signExtend) {
144
int i = offset;
145
switch (numBytes) {
146
case 0:
147
return 0;
148
case 1:
149
if (signExtend)
150
return byteArray[i];
151
else
152
return (short) (byteArray[i] & 0x00FF);
153
case 2:
154
if (bigEndian) {
155
return (short) (((byteArray[i] & 0xFF) << 8) | ((byteArray[i + 1] & 0xFF)));
156
} else {
157
return (short) (((byteArray[i + 1] & 0xFF) << 8) | ((byteArray[i] & 0xFF)));
158
}
159
default:
160
return 0;
161
}
162
}
163
164
/**
165
* Returns an int value copied from four consecutive bytes starting at the
166
* offset.
167
*
168
* @param byteArray
169
* source
170
* @param offset
171
* offset in the byte array
172
* @param bigEndian
173
* if false the bytes will be copied in reverse (little endian)
174
* order
175
*
176
* @return int
177
*
178
* @throws NullPointerException
179
* if byteArray is null
180
* @throws ArrayIndexOutOfBoundsException
181
* if an invalid array access occurs
182
*/
183
public static int readInt(byte[] byteArray, int offset, boolean bigEndian) {
184
if ((offset + 4 > byteArray.length) || (offset < 0))
185
throw new ArrayIndexOutOfBoundsException("Array access index out of bounds. " +
186
"readInt is trying to access byteArray[" + offset + "] to byteArray[" + (offset + 3) + "], " +
187
" but valid indices are from 0 to " + (byteArray.length - 1) + ".");
188
189
if (bigEndian)
190
{
191
return readInt_(byteArray, offset, true);
192
}
193
else
194
{
195
return readInt_(byteArray, offset, false);
196
}
197
}
198
199
private static int readInt_(byte[] byteArray, int offset, boolean bigEndian) {
200
if (bigEndian) {
201
return ((byteArray[offset] & 0xFF) << 24)
202
| ((byteArray[offset + 1] & 0xFF) << 16)
203
| ((byteArray[offset + 2] & 0xFF) << 8)
204
| ((byteArray[offset + 3] & 0xFF));
205
} else {
206
return ((byteArray[offset + 3] & 0xFF) << 24)
207
| ((byteArray[offset + 2] & 0xFF) << 16)
208
| ((byteArray[offset + 1] & 0xFF) << 8)
209
| ((byteArray[offset] & 0xFF));
210
}
211
}
212
213
/**
214
* Returns an int value copied from zero to four consecutive bytes of the
215
* byte array starting at the offset.
216
*
217
* @param byteArray
218
* source
219
* @param offset
220
* offset in the byte array
221
* @param bigEndian
222
* if false the bytes will be copied in reverse (little endian)
223
* order
224
* @param numBytes
225
* the number of bytes to unmarshall, must be 0-4 inclusive
226
* @param signExtend
227
* if true and <code>numBytes &lt; 4</code> then the topmost
228
* bytes of the returned int will be sign extended
229
*
230
* @return int
231
*
232
* @throws NullPointerException
233
* if <code>byteArray</code> is null
234
* @throws IllegalArgumentException
235
* if <code>numBytes &lt; 0</code> or
236
* <code>numBytes &gt; 4</code>
237
* @throws ArrayIndexOutOfBoundsException
238
* if an invalid array access occurs
239
*/
240
public static int readInt(byte[] byteArray, int offset, boolean bigEndian,
241
int numBytes, boolean signExtend)
242
{
243
if ((offset + numBytes > byteArray.length) || (offset < 0))
244
throw new ArrayIndexOutOfBoundsException("Access offset must be positive or zero and last byte must be in range.");
245
if (numBytes < 0 || numBytes > 4)
246
throw new IllegalArgumentException("numBytes == " + numBytes);
247
248
if (bigEndian)
249
{
250
if (signExtend)
251
return readInt_(byteArray, offset, true, numBytes, true);
252
else
253
return readInt_(byteArray, offset, true, numBytes, false);
254
}
255
else
256
{
257
if (signExtend)
258
return readInt_(byteArray, offset, false, numBytes, true);
259
else
260
return readInt_(byteArray, offset, false, numBytes, false);
261
}
262
}
263
264
private static int readInt_(byte[] byteArray, int offset, boolean bigEndian,
265
int numBytes, boolean signExtend) {
266
int i = offset;
267
int answer;
268
switch (numBytes) {
269
case 0:
270
return 0;
271
case 1:
272
if (signExtend)
273
return byteArray[i];
274
else
275
return byteArray[i] & 0x000000FF;
276
case 2:
277
if (bigEndian) {
278
answer = (((byteArray[i] & 0xFF) << 8) | (byteArray[i + 1] & 0xFF));
279
} else {
280
answer = (((byteArray[i + 1] & 0xFF) << 8) | (byteArray[i] & 0xFF));
281
}
282
if (signExtend)
283
return (short) answer;
284
else
285
return answer & 0x0000FFFF;
286
case 3:
287
if (bigEndian) {
288
answer = ((byteArray[i] & 0xFF) << 16)
289
| ((byteArray[i + 1] & 0xFF) << 8)
290
| ((byteArray[i + 2] & 0xFF));
291
} else {
292
answer = ((byteArray[i + 2] & 0xFF) << 16)
293
| ((byteArray[i + 1] & 0xFF) << 8)
294
| ((byteArray[i] & 0xFF));
295
}
296
/* if the most significant bit is 1, we need to do sign extension */
297
if (signExtend && (answer & (1 << (3 * 8 - 1))) != 0) {
298
answer |= 0xFF000000;
299
}
300
return answer;
301
case 4:
302
if (bigEndian) {
303
return ((byteArray[i] & 0xFF) << 24)
304
| ((byteArray[i + 1] & 0xFF) << 16)
305
| ((byteArray[i + 2] & 0xFF) << 8)
306
| ((byteArray[i + 3] & 0xFF));
307
} else {
308
return ((byteArray[i + 3] & 0xFF) << 24)
309
| ((byteArray[i + 2] & 0xFF) << 16)
310
| ((byteArray[i + 1] & 0xFF) << 8)
311
| ((byteArray[i] & 0xFF));
312
}
313
default:
314
return 0;
315
}
316
}
317
318
/**
319
* Returns a long value copied from eight consecutive bytes of the byte
320
* array starting at the offset.
321
*
322
* @param byteArray
323
* source
324
* @param offset
325
* offset in the byte array
326
* @param bigEndian
327
* if false the bytes will be copied in reverse (little endian)
328
* order
329
*
330
* @return long
331
*
332
* @throws NullPointerException
333
* if <code>byteArray</code> is null
334
* @throws ArrayIndexOutOfBoundsException
335
* if an invalid array access occurs
336
*/
337
public static long readLong(byte[] byteArray, int offset, boolean bigEndian) {
338
if ((offset + 8 > byteArray.length) || (offset < 0))
339
throw new ArrayIndexOutOfBoundsException("Array access index out of bounds. " +
340
"readLong is trying to access byteArray[" + offset + "] to byteArray[" + (offset + 7) + "], " +
341
" but valid indices are from 0 to " + (byteArray.length - 1) + ".");
342
343
if (bigEndian)
344
{
345
return readLong_(byteArray, offset, true);
346
}
347
else
348
{
349
return readLong_(byteArray, offset, false);
350
}
351
}
352
353
private static long readLong_(byte[] byteArray, int offset, boolean bigEndian) {
354
if (bigEndian) {
355
return (((long) (byteArray[offset] & 0xFF)) << 56)
356
| (((long) (byteArray[offset + 1] & 0xFF)) << 48)
357
| (((long) (byteArray[offset + 2] & 0xFF)) << 40)
358
| (((long) (byteArray[offset + 3] & 0xFF)) << 32)
359
| (((long) (byteArray[offset + 4] & 0xFF)) << 24)
360
| (((byteArray[offset + 5] & 0xFF)) << 16)
361
| (((byteArray[offset + 6] & 0xFF)) << 8)
362
| (((byteArray[offset + 7] & 0xFF)));
363
} else {
364
return (((long) (byteArray[offset + 7] & 0xFF)) << 56)
365
| (((long) (byteArray[offset + 6] & 0xFF)) << 48)
366
| (((long) (byteArray[offset + 5] & 0xFF)) << 40)
367
| (((long) (byteArray[offset + 4] & 0xFF)) << 32)
368
| (((long) (byteArray[offset + 3] & 0xFF)) << 24)
369
| (((byteArray[offset + 2] & 0xFF)) << 16)
370
| (((byteArray[offset + 1] & 0xFF)) << 8)
371
| (((byteArray[offset] & 0xFF)));
372
}
373
}
374
375
/**
376
* Returns a long value copied from zero to eight consecutive bytes of the
377
* byte array starting at the offset.
378
*
379
* @param byteArray
380
* source
381
* @param offset
382
* offset in the byte array
383
* @param bigEndian
384
* if false the bytes will be copied in reverse (little endian)
385
* order
386
* @param numBytes
387
* the number of bytes to unmarshall, must be 0-8 inclusive
388
* @param signExtend
389
* if true and <code>numBytes &lt; 8</code> then the topmost
390
* bytes of the returned long will be sign extended
391
*
392
* @return long
393
*
394
* @throws NullPointerException
395
* if <code>byteArray</code> is null
396
* @throws IllegalArgumentException
397
* if <code>numBytes &lt; 0</code> or
398
* <code>numBytes &gt; 8</code>
399
* @throws ArrayIndexOutOfBoundsException
400
* if an invalid array access occurs
401
*/
402
public static long readLong(byte[] byteArray, int offset,
403
boolean bigEndian, int numBytes, boolean signExtend) {
404
if ((offset + numBytes > byteArray.length) || (offset < 0))
405
throw new ArrayIndexOutOfBoundsException("Access offset must be positive or zero and last byte must be in range.");
406
if (numBytes < 0 || numBytes > 8)
407
throw new IllegalArgumentException("numBytes == " + numBytes);
408
409
if (bigEndian)
410
{
411
if (signExtend)
412
return readLong_(byteArray, offset, true, numBytes, true);
413
else
414
return readLong_(byteArray, offset, true, numBytes, false);
415
}
416
else
417
{
418
if (signExtend)
419
return readLong_(byteArray, offset, false, numBytes, true);
420
else
421
return readLong_(byteArray, offset, false, numBytes, false);
422
}
423
}
424
private static long readLong_(byte[] byteArray, int offset,
425
boolean bigEndian, int numBytes, boolean signExtend) {
426
int i = offset;
427
long answer;
428
switch (numBytes) {
429
case 0:
430
return 0;
431
case 1:
432
if (signExtend)
433
return byteArray[i];
434
else
435
return byteArray[i] & 0x00000000000000FFl;
436
case 2:
437
if (bigEndian) {
438
answer = (((byteArray[i] & 0xFF) << 8) | (byteArray[i + 1] & 0xFF));
439
} else {
440
answer = (((byteArray[i + 1] & 0xFF) << 8) | (byteArray[i] & 0xFF));
441
}
442
if (signExtend)
443
return (short) answer;
444
else
445
return answer & 0x000000000000FFFFl;
446
case 3:
447
if (bigEndian) {
448
answer = (((byteArray[i]) & 0xFF) << 16)
449
| (((byteArray[i + 1]) & 0xFF) << 8)
450
| (((byteArray[i + 2]) & 0xFF));
451
452
} else {
453
answer = (((byteArray[i + 2]) & 0xFF) << 16)
454
| (((byteArray[i + 1]) & 0xFF) << 8)
455
| (((byteArray[i]) & 0xFF));
456
457
}
458
459
if (signExtend) {
460
answer = (answer << 40) >> 40;
461
}
462
463
return answer;
464
case 4:
465
if (bigEndian) {
466
answer = ((((long) byteArray[i]) & 0xFF) << 24)
467
| (((byteArray[i + 1]) & 0xFF) << 16)
468
| (((byteArray[i + 2]) & 0xFF) << 8)
469
| (((byteArray[i + 3]) & 0xFF));
470
471
} else {
472
answer = ((((long) byteArray[i + 3]) & 0xFF) << 24)
473
| (((byteArray[i + 2]) & 0xFF) << 16)
474
| (((byteArray[i + 1]) & 0xFF) << 8)
475
| (((byteArray[i]) & 0xFF));
476
477
}
478
479
if (signExtend) {
480
answer = (answer << 32) >> 32;
481
}
482
483
return answer;
484
case 5:
485
if (bigEndian) {
486
answer = ((((long) byteArray[i]) & 0xFF) << 32)
487
| ((((long) byteArray[i + 1]) & 0xFF) << 24)
488
| (((byteArray[i + 2]) & 0xFF) << 16)
489
| (((byteArray[i + 3]) & 0xFF) << 8)
490
| (((byteArray[i + 4]) & 0xFF));
491
492
} else {
493
answer = ((((long) byteArray[i + 4]) & 0xFF) << 32)
494
| ((((long) byteArray[i + 3]) & 0xFF) << 24)
495
| (((byteArray[i + 2]) & 0xFF) << 16)
496
| (((byteArray[i + 1]) & 0xFF) << 8)
497
| (((byteArray[i]) & 0xFF));
498
499
}
500
501
if (signExtend) {
502
answer = (answer << 24) >> 24;
503
}
504
return answer;
505
case 6:
506
if (bigEndian) {
507
answer = ((((long) byteArray[i]) & 0xFF) << 40)
508
| ((((long) byteArray[i + 1]) & 0xFF) << 32)
509
| ((((long) byteArray[i + 2]) & 0xFF) << 24)
510
| (((byteArray[i + 3]) & 0xFF) << 16)
511
| (((byteArray[i + 4]) & 0xFF) << 8)
512
| (((byteArray[i + 5]) & 0xFF));
513
514
} else {
515
answer = ((((long) byteArray[i + 5]) & 0xFF) << 40)
516
| ((((long) byteArray[i + 4]) & 0xFF) << 32)
517
| ((((long) byteArray[i + 3]) & 0xFF) << 24)
518
| (((byteArray[i + 2]) & 0xFF) << 16)
519
| (((byteArray[i + 1]) & 0xFF) << 8)
520
| (((byteArray[i]) & 0xFF));
521
}
522
523
if (signExtend) {
524
answer = (answer << 16) >> 16;
525
}
526
return answer;
527
case 7:
528
if (bigEndian) {
529
answer = ((((long) byteArray[i]) & 0xFF) << 48)
530
| ((((long) byteArray[i + 1]) & 0xFF) << 40)
531
| ((((long) byteArray[i + 2]) & 0xFF) << 32)
532
| ((((long) byteArray[i + 3]) & 0xFF) << 24)
533
| (((byteArray[i + 4]) & 0xFF) << 16)
534
| (((byteArray[i + 5]) & 0xFF) << 8)
535
| (((byteArray[i + 6]) & 0xFF));
536
537
} else {
538
answer = ((((long) byteArray[i + 6]) & 0xFF) << 48)
539
| ((((long) byteArray[i + 5]) & 0xFF) << 40)
540
| ((((long) byteArray[i + 4]) & 0xFF) << 32)
541
| ((((long) byteArray[i + 3]) & 0xFF) << 24)
542
| (((byteArray[i + 2]) & 0xFF) << 16)
543
| (((byteArray[i + 1]) & 0xFF) << 8)
544
| (((byteArray[i]) & 0xFF));
545
546
}
547
548
if (signExtend) {
549
answer = (answer << 8) >> 8;
550
}
551
552
return answer;
553
case 8:
554
if (bigEndian) {
555
return ((((long) byteArray[i]) & 0xFF) << 56)
556
| ((((long) byteArray[i + 1]) & 0xFF) << 48)
557
| ((((long) byteArray[i + 2]) & 0xFF) << 40)
558
| ((((long) byteArray[i + 3]) & 0xFF) << 32)
559
| ((((long) byteArray[i + 4]) & 0xFF) << 24)
560
| (((byteArray[i + 5]) & 0xFF) << 16)
561
| (((byteArray[i + 6]) & 0xFF) << 8)
562
| (((byteArray[i + 7]) & 0xFF));
563
} else {
564
return ((((long) byteArray[i + 7]) & 0xFF) << 56)
565
| ((((long) byteArray[i + 6]) & 0xFF) << 48)
566
| ((((long) byteArray[i + 5]) & 0xFF) << 40)
567
| ((((long) byteArray[i + 4]) & 0xFF) << 32)
568
| ((((long) byteArray[i + 3]) & 0xFF) << 24)
569
| (((byteArray[i + 2]) & 0xFF) << 16)
570
| (((byteArray[i + 1]) & 0xFF) << 8)
571
| (((byteArray[i]) & 0xFF));
572
}
573
default:
574
return 0;
575
}
576
}
577
578
/**
579
* Returns a float value copied from four consecutive bytes of the byte
580
* array starting at the offset.
581
*
582
* @param byteArray
583
* source
584
* @param offset
585
* offset in the byte array
586
* @param bigEndian
587
* if false the bytes will be copied in reverse (little endian)
588
* order
589
*
590
* @return float
591
*
592
* @throws NullPointerException
593
* if <code>byteArray</code> is null
594
* @throws ArrayIndexOutOfBoundsException
595
* if an invalid array access occurs
596
*/
597
public static float readFloat(byte[] byteArray, int offset,
598
boolean bigEndian) {
599
if ((offset + 4 > byteArray.length) || (offset < 0))
600
throw new ArrayIndexOutOfBoundsException("Array access index out of bounds. " +
601
"readFloat is trying to access byteArray[" + offset + "] to byteArray[" + (offset + 3) + "], " +
602
" but valid indices are from 0 to " + (byteArray.length - 1) + ".");
603
604
if (bigEndian)
605
return readFloat_(byteArray, offset, true);
606
else
607
return readFloat_(byteArray, offset, false);
608
}
609
610
private static float readFloat_(byte[] byteArray, int offset,
611
boolean bigEndian) {
612
return Float.intBitsToFloat(readInt(byteArray, offset, bigEndian));
613
}
614
615
/**
616
* Returns a double value copied from eight consecutive bytes of the byte
617
* array starting at the offset.
618
*
619
* @param byteArray
620
* source
621
* @param offset
622
* offset in the byte array
623
* @param bigEndian
624
* if false the bytes will be copied in reverse (little endian)
625
* order
626
*
627
* @return double
628
*
629
* @throws NullPointerException
630
* if <code>byteArray</code> is null
631
* @throws ArrayIndexOutOfBoundsException
632
* if an invalid array access occurs
633
*/
634
public static double readDouble(byte[] byteArray, int offset,
635
boolean bigEndian) {
636
if ((offset + 8 > byteArray.length) || (offset < 0))
637
throw new ArrayIndexOutOfBoundsException("Array access index out of bounds. " +
638
"readDouble is trying to access byteArray[" + offset + "] to byteArray[" + (offset + 7) + "], " +
639
" but valid indices are from 0 to " + (byteArray.length - 1) + ".");
640
641
if (bigEndian)
642
return readDouble_(byteArray, offset, true);
643
else
644
return readDouble_(byteArray, offset, false);
645
}
646
private static double readDouble_(byte[] byteArray, int offset,
647
boolean bigEndian) {
648
return Double.longBitsToDouble(readLong(byteArray, offset, bigEndian));
649
}
650
}
651
652