byte[] bytes = new byte[256];
// TODO
int count = 0;
int total = 0;
ByteBuffer buffer = ByteBuffer.allocate(1024);
while ((count = fi.read(bytes)) != -1) {
buffer.put(bytes);
total += count;
}
byte[] dataReceived = buffer.array();
报异常java.nio.BufferOverflowException