rendered paste body /* client is a SocketChannel * buf is a ByteBuffer(512) * str is a StringBuffer(100) */ try { while((rd = client.read(buf)) > 0) { log.debug("Read " + rd + " bytes"); buf.flip(); str.append(dec.decode(buf).toString()); buf.flip(); } } catch(IOException e) { log.error("Error reading from client " + client.socket().getInetAddress().getHostAddress() + ":" + client.socket().getPort(), e); key.interestOps(key.interestOps() | SelectionKey.OP_READ); return; }############################GDB output:WorkerThread caught Runtime Exeception executing class com.jatosoft.java.pug.PugNioReaderjava.lang.IllegalArgumentException at java.nio.Buffer.position(int) (/usr/lib/libgcj.so.6.0.0) at gnu.java.nio.SocketChannelImpl.read(java.nio.ByteBuffer) (/usr/lib/libgcj.so.6.0.0) at com.jatosoft.java.pug.PugNioReader.run() (/home/ben/workspace/Pug/com/jatosoft/java/pug/PugNioReader.java:97) at com.jatosoft.java.pug.WorkQueue$WorkerThread.run() (/home/ben/workspace/Pug/com/jatosoft/java/pug/WorkQueue.java:133) at .GC_start_routine (/usr/lib/libgcj.so.6.0.0) at .__clone (/lib/libc-2.3.5.so)