File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/main/java/com/microsoft/sqlserver/jdbc Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 4
4
*/
5
5
package com .microsoft .sqlserver .jdbc ;
6
6
7
+ import java .nio .Buffer ;
7
8
import java .nio .ByteBuffer ;
8
9
import java .nio .ByteOrder ;
9
10
import java .text .MessageFormat ;
@@ -56,7 +57,12 @@ static Vector fromBytes(byte[] bytes) {
56
57
57
58
ByteBuffer buffer = ByteBuffer .wrap (bytes ).order (ByteOrder .LITTLE_ENDIAN );
58
59
59
- buffer .position (getHeaderLength ()); // Skip the first 8 bytes (header)
60
+ /*
61
+ * The cast is required for JDK 8 compatibility.
62
+ * JDK 8 calls method Buffer.position(I)LBuffer,
63
+ * while in JDK 9+ calls method ByteBuffer.position(I)LByteBuffer
64
+ */
65
+ ((Buffer ) buffer ).position (getHeaderLength ()); // Skip the first 8 bytes (header)
60
66
61
67
for (int i = 0 ; i < objectCount ; i ++) {
62
68
objectArray [i ] = buffer .getFloat ();
You can’t perform that action at this time.
0 commit comments