[jax-rs-spec users] [jsr339-experts] ReaderInterceptor example question

From: Jan Algermissen <>
Date: Sun, 21 Oct 2012 14:06:54 +0200


in the spec it says in the reader interceptor example

    Object aroundReadFrom(ReaderInterceptorContext ctx) ... {

        InputStream old = ctx.getInputStream();
        ctx.setInputStream(new GZIPInputStream(old));
        try {

            return ctx.proceed();
        } finally {



Which means that the old input stream will *always* be restore, not just in the exceptional case.

I wonder: am I just making some stupid mistake or is that a bug in the text or is that a pattern that has to be applied to every reader interceptor anyone is going to write?