class BoshDecoder {

    public void decode() throws IOException, SAXException {
        IoBuffer ioBuf = IoBuffer.allocate(1024);
        ioBuf.setAutoExpand(true);
        byte[] buf = new byte[1024];
        InputStream in = request.getInputStream();

        for (;;) {
            int i = in.read(buf);
            if (i == -1) {
                break;
            }
            ioBuf.put(buf, 0, i);
        }
        ioBuf.flip();
        reader.parse(ioBuf, CharsetUtil.getDecoder());
    }

    public  BoshDecoder(BoshHandler boshHandler, HttpServletRequest req);

}