All pastes #4672 Raw Edit

Anonymous

public java v1 · immutable
#4672 ·published 2005-01-24 10:46 UTC
rendered paste body
ByteBuffer b = ByteBuffer.allocateDirect(2048);      //System.out.println("Sending:");      //SimpleProtocolDecoder.printHex(packet.getBytes());      b.put(packet.getBytes());      int size = b.position() + 2;      byte[] pcktLength = {(byte)(size & 0xff), (byte)(size >> 8 &0xff)};      b = ByteBuffer.allocateDirect(size);      b.put(pcktLength);      b.put(packet.getBytes());      b.flip();      return b;