196197198199200201202203204205206
if (readBytes == -1) { throw new EOFException("Remote socket closed!"); } readBuffer.flip(); } boolean complete = packet.readFrom(readBuffer); if (complete) { if (readBuffer.hasRemaining()) { readFromSocket = false; } else { readBuffer.compact();
355356357358359360361362363364365
boolean writeDone; boolean readDone; do { writeDone = packet.writeTo(buffer); buffer.flip(); readDone = newPacket.readFrom(buffer); if (buffer.hasRemaining()) { throw new IllegalStateException("Buffer should be empty! " + buffer); } buffer.clear(); } while (!writeDone);
235236237238239240241242243244
SerializationService ss2 = createSerializationService(1); buffer.flip(); packet = new Packet(ss2.getPortableContext()); assertTrue(packet.readFrom(buffer)); AuthenticationRequest request = ss2.toObject(packet.getData()); } }
188189190191192193194195196197198