Flip the buffer before returning it.
So that it's ready for the caller to read.
@@ -271,6 +271,7 @@ public class JavaAssets extends Assets {
FileChannel fc = in.getChannel()) {
ByteBuffer buf = ByteBuffer.allocateDirect((int)fc.size()); // no >2GB files
fc.read(buf);
+ buf.flip();
return buf;
}
}
