System.err.println("GrizzlySocketChannel.read");
    public int read(ByteBuffer dst) throws IOException    {        System.err.println("GrizzlySocketChannel.read");                if (key==null)            return -1;        int count=1;        int byteRead=0;        Selector readSelector=null;        SelectionKey tmpKey=null;        try        {            SocketChannel socketChannel=(SocketChannel)key.channel();            while (count>0)            {                count=socketChannel.read(dst);                if (count>-1)                    byteRead+=count;                else                    byteRead=count;            }            if (byteRead==0)            {                readSelector=SelectorFactory.getSelector();                if (readSelector==null)                {                    return 0;                }                count=1;                tmpKey=socketChannel.register(readSelector,SelectionKey.OP_READ);                tmpKey.interestOps(tmpKey.interestOps()|SelectionKey.OP_READ);                int code=readSelector.select(readTimeout);                tmpKey.interestOps(tmpKey.interestOps()&(~SelectionKey.OP_READ));                if (code==0)                {                    throw new IOException("timing out");                }                while (count>0)                {                    count=socketChannel.read(dst);                    if (count>-1)                        byteRead+=count;                    else                        byteRead=count;                }            }        }        finally        {            if (tmpKey!=null)                tmpKey.cancel();            if (readSelector!=null)            {                // Bug 6403933                try                {                    readSelector.selectNow();                }                catch (IOException ex)                {                    ;                }                SelectorFactory.returnSelector(readSelector);            }        }        return byteRead;    }