Or you could add IoBuffer#getHexDump(start, end)?
On Tue, May 22, 2018 at 12:55 PM Emmanuel Lécharny <[email protected]>
wrote:
>
>
> Le 22/05/2018 à 18:37, Jonathan Valliere a écrit :
> > I don’t think there is any benefit of having it public. It’s only useable
> > with IoBuffer and it’s built in to IoBuffer. Unless someone added more
> > functions to it which aren’t present in IoBuffer such as hex ranges then
> > might as well leave it as is.
>
> Actually, I was thinking about adding debug code in
> NioConnector/NioProcessor in the read/write methods to get a peek of
> what is being read from a socket or written in a socket :
>
> protected int read(NioSession session, IoBuffer buf) throws Exception {
> ByteChannel channel = session.getChannel();
>
> int nbRead = channel.read(buf.buf());
>
> if (nbRead != 0) {
> IoBuffer copy = buf.duplicate();
> copy.flip();
>
> System.out.println("<<< NioSelector read: " +
> IoBufferHexDumper.getHexdump(copy, nbRead));
> }
>
> return nbRead;
> }
>
>
> (this code is just for some debug session I'm conducting atm, and I used
> the old version of the dumper. That explains the sysout that should be
> replaced by proper Log calls).
>
>
> --
> Emmanuel Lecharny
>
> Symas.com
> directory.apache.org
>
>