Random java.lang.IllegalArgumentException when using kryonet

I have been playing around with cryonet and i have found that i keep getting a

[quote]Exception in thread “Thread-0” java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:236)
at com.esotericsoftware.kryonet.TcpConnection.send(TcpConnection.java:206)
at com.esotericsoftware.kryonet.Connection.sendTCP(Connection.java:77)
at com.horizon.game.map.MapData.pullChunkFromServer(MapData.java:1202)
[/quote]
randomly, everything seems to work fine but randomly on occasions i get this, anyone know a fix since it seems to be a fault with kryonet itself?

Just looking at kryonet’s source, it seems that that error occurs when you overfill the [icode]writeBuffer[/icode] object.

In the constructor for a TcpConnection, it seems you set the writebuffer size. Maybe try increasing that slightly?