boolean function ( byte [ ] arg0 ) { if ( arg0 == null || arg0 . length < 2 ) { return false ; } return ( arg0 [ 0 ] == GZIP_MAGIC_NUMBER_BYTE_1 && arg0 [ 1 ] == GZIP_MAGIC_NUMBER_BYTE_2 ) ; }
checks the first two bytes of the candidate byte array for the magic number 0x677a . this magic number was obtained from / usr/share/file / magic . the line for gzip is : >> 14 beshort 0x677a gzipped concode_field_sep int GZIP_MAGIC_NUMBER_BYTE_1 concode_elem_sep Map<String,Serializable> requestAttributes concode_elem_sep long timeToLiveSeconds concode_elem_sep java.util.Set<String> IGNORED_INTERFACES concode_elem_sep long ONE_YEAR_IN_SECONDS concode_elem_sep Date created concode_elem_sep boolean storeGzipped concode_elem_sep Pattern PATTERN_CACHE_DIRECTIVE concode_elem_sep HttpDateFormatter httpDateFormatter concode_elem_sep int FOUR_KB concode_elem_sep int GZIP_MAGIC_NUMBER_BYTE_2 concode_elem_sep List<SerializableCookie> serializableCookies concode_elem_sep byte[] gzippedBody concode_elem_sep byte[] ungzippedBody concode_elem_sep List<Header<? extends Serializable>> responseHeaders concode_elem_sep String contentType concode_elem_sep long serialVersionUID concode_elem_sep int statusCode concode_field_sep void setCacheableRequestAttributes concode_elem_sep byte[] getGzippedBody concode_elem_sep List<Header<? extends Serializable>> getHeaders concode_elem_sep long getDateHeader concode_elem_sep Date getCreated concode_elem_sep byte[] gzip concode_elem_sep List<SerializableCookie> getSerializableCookies concode_elem_sep long getTimeToLiveSeconds concode_elem_sep byte[] getUngzippedBody concode_elem_sep Map<String,Serializable> getRequestAttributes concode_elem_sep boolean isMatch concode_elem_sep boolean hasUngzippedBody concode_elem_sep String getHeader concode_elem_sep boolean isInvalidObject concode_elem_sep int getStatusCode concode_elem_sep boolean isModified concode_elem_sep byte[] ungzip concode_elem_sep boolean isOk concode_elem_sep void setTimeToLiveWithCheckForNeverExpires concode_elem_sep String getContentType concode_elem_sep Map<String,Object> getCacheDirectives concode_elem_sep boolean isBodyParameterGzipped concode_elem_sep boolean hasGzippedBody