@Override
            public synchronized void write(int b) throws IOException {
                outAppData.put((byte) b);
                outAppData.flip();
                doWrite(outAppData);
                outAppData.clear();
            }
<code>TLSWrapper</code> is a TLS wrapper for connections requiring TLS protocol.
xmppserver/src/main/java/org/jivesoftware/openfire/net/TLSStreamWriter.java