Tôi cần phải chuyển đổi một dấu thăng bằng thành kép. Tôi đang sử dụngjava.nio.BufferUnderflowException khi chuyển đổi mảng byte thành double
double dvalue = ByteBuffer.wrap(value).getDouble();
Nhưng tại thời gian chạy Tôi nhận BufferUnderflowException ngoại lệ
Exception in thread "main" java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:498)
at java.nio.HeapByteBuffer.getDouble(HeapByteBuffer.java:508)
at Myclass.main(Myclass.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
sao tôi cần phải thay đổi ở đây là gì?
bạn có thể cho chúng tôi khai báo giá trị không? với một số mã. –