I need to receive an array or a class containing floats from a c++ client to java server using sockets. But the InputStreamReader is not getting it right. Any reasons. Any sugge
I suggest you try
DataInputStream ins = new DataInputStream(socket.getInputStream()); byte[] bytes = new bytes[48]; ins.readFuly(bytes); ByteBuffer bb = ByteBuffer.wrap(bytes).order(ByteOrder.nativeOrder()); values.tWidth = bb.getFloat(); value.waterLevel = bb.getFloat(); // etc