@Override
        public int read() throws IOException {
            int readByte = originalStream.read();
            if (readByte > -1) {
                incrementIncomingCounter(1);
            }
            return readByte;
        }
Original input stream being wrapped to count incmoing traffic.
xmppserver/src/main/java/org/jivesoftware/openfire/net/ServerTrafficCounter.java