Originariamente inviato da andbin
- Crei il tuo ByteBuffer, come hai fatto tramite allocate()
- Imposti l'order little-endian, come hai fatto tramite order(ByteOrder.LITTLE_ENDIAN)
- Fai il put del double
- Imposti l'order big-endian, tramite order(ByteOrder.BIG_ENDIAN)
- Fai il get del double

C'è solo uno step in più ... quello per impostare il big-endian.
Scusa ma non funziona proprio, l'output è sempre lo stesso

DataInputStream dis = new DataInputStream(new FileInputStream ("weights.dat"));

ByteBuffer bb = ByteBuffer.allocate(9000);
// bb.order(ByteOrder.LITTLE_ENDIAN);

for(int i=0;i<896.;i++)
{
var=dis.readDouble();
bb.putDouble(i,var);
// bb.order(ByteOrder.BIG_ENDIAN);
System.out.println(var +"__"+ bb.order(ByteOrder.BIG_ENDIAN).getDouble(i) +"__"+i);
}