/** * This is a utility function others can call that checks if * is is a GZIP stream if so it returns a GZIPInputStream that * will decode the contents, otherwise it returns (or a * buffered version of is) untouched. * @param is Stream that may potentially be a GZIP stream. */ public static InputStream checkGZIP(InputStream is) throws IOException { return ParsedURLData.checkGZIP(is); }
/** * This is a utility function others can call that checks if * is is a GZIP stream if so it returns a GZIPInputStream that * will decode the contents, otherwise it returns (or a * buffered version of is) untouched. * @param is Stream that may potentially be a GZIP stream. */ public static InputStream checkGZIP(InputStream is) throws IOException { return ParsedURLData.checkGZIP(is); }
/** * This is a utility function others can call that checks if * is is a GZIP stream if so it returns a GZIPInputStream that * will decode the contents, otherwise it returns (or a * buffered version of is) untouched. * @param is Stream that may potentially be a GZIP stream. */ public static InputStream checkGZIP(InputStream is) throws IOException { return ParsedURLData.checkGZIP(is); }
/** * Open the stream and check for common compression types. If * the stream is found to be compressed with a standard * compression type it is automatically decompressed. * @param userAgent The user agent opening the stream (may be null). * @param mimeTypes The expected mime types of the content * in the returned InputStream (mapped to Http accept * header among other possability). The elements of * the iterator must be strings (may be null) */ public InputStream openStream(String userAgent, Iterator mimeTypes) throws IOException { InputStream raw = openStreamInternal(userAgent, mimeTypes, acceptedEncodings.iterator()); if (raw == null) return null; stream = null; return checkGZIP(raw); }
/** * Open the stream and check for common compression types. If * the stream is found to be compressed with a standard * compression type it is automatically decompressed. * @param userAgent The user agent opening the stream (may be null). * @param mimeTypes The expected mime types of the content * in the returned InputStream (mapped to Http accept * header among other possability). The elements of * the iterator must be strings (may be null) */ public InputStream openStream(String userAgent, Iterator mimeTypes) throws IOException { InputStream raw = openStreamInternal(userAgent, mimeTypes, acceptedEncodings.iterator()); if (raw == null) return null; stream = null; return checkGZIP(raw); }
/** * Open the stream and check for common compression types. If * the stream is found to be compressed with a standard * compression type it is automatically decompressed. * @param userAgent The user agent opening the stream (may be null). * @param mimeTypes The expected mime types of the content * in the returned InputStream (mapped to Http accept * header among other possability). The elements of * the iterator must be strings (may be null) */ public InputStream openStream(String userAgent, Iterator mimeTypes) throws IOException { InputStream raw = openStreamInternal(userAgent, mimeTypes, acceptedEncodings.iterator()); if (raw == null) return null; stream = null; return checkGZIP(raw); }