private String read(SocketChannel socket, byte[] buffer) {
ByteBuffer buf = ByteBuffer.wrap(buffer, 0, buffer.length); while (buf.position() != buf.limit()) {
int count; count = socket.read(buf);
if (count < 0) {
}
} return new String(buffer, 0, buf.position(), AdbHelper.DEFAULT_ENCODING);
return null;
}
可以用MemoryStream替代试试