LongBuffer direct_buffer = lookupBuffer(buffer);
direct_buffer.clear();
int saved_position = buffer.position();
direct_buffer.put(buffer);
buffer.position(saved_position);
direct_buffer.flip();
return direct_buffer;
}
private static DoubleBuffer lookupBuffer(DoubleBuffer buffer) {
CachedBuffers buffers = getCachedBuffers(buffer.remaining()*8);