@Override
            public synchronized int read() throws IOException {
                doRead();
                if (!inAppBB.hasRemaining()) {
                    return -1;
                }
                return inAppBB.get();
            }
<code>inAppBB</code> buffer keeps decypted data.
xmppserver/src/main/java/org/jivesoftware/openfire/net/TLSStreamReader.java