代码如下
DataInputStream inputStream = null;
inputStream = cs.getMessageStream();
byte[] buf = new byte[4];
int readLength=inputStream.read(buf,0,buf.length);
po = new Pointer(MemoryBlockFactory.createMemoryBlock(readLength));
po.setMemory(buf);
int lens=po.getAsInt(0);
System.out.println("lens="+lens);
我读取C Server返回过来的信息 我读取前4个字节 为什么会在int readLength=inputStream.read(buf,0,buf.length);这里卡住 或直接不往下执行 帮忙看下 最好能提供下修改的代码 谢谢了
[b]问题补充:[/b]
服务器端有返回的数据 只是在哪个地方卡住了
和C通讯比较麻烦,你看看C那边返回信息了没有,如果返回了,看看是什么类型的,我也遇到过类似的问题,结果最后才发现时数据类型不对。