code: public static OutputStream unpackFilterOutputStream(FilterOutputStream os) throws IllegalAccessException {
      try {
        Field field = FilterOutputStream.class.getDeclaredField("out");
        field.setAccessible(true);
        return (OutputStream) field.get(os);
      } catch (NoSuchFieldException nsfe) {
        throw new RuntimeException(nsfe);
      }
    }
docs: Finds the underlying {@link OutputStream} to a {@link FilterOutputStream}. Note this is not always possible due
  to security restrictions of the JVM.
  @throws IllegalAccessException If security policies of the JVM prevent unpacking of the {@link FilterOutputStream}.