public class GZipResource extends CompressedResource
Wraps around another resource, delegates all queries to that other resource but uncompresses/compresses streams on the fly.
MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
description, location, project
Constructor and Description |
---|
GZipResource()
A no-arg constructor
|
GZipResource(ResourceCollection other)
Constructor with another resource to wrap.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getCompressionName()
Get the name of the compression method.
|
protected java.io.InputStream |
wrapStream(java.io.InputStream in)
Decompress on the fly using java.util.zip.GZIPInputStream.
|
protected java.io.OutputStream |
wrapStream(java.io.OutputStream out)
Compress on the fly using java.util.zip.GZIPOutStream.
|
toString
as, getInputStream, getOutputStream, getSize, isAppendSupported
addConfigured, compareTo, dieOnCircularReference, getLastModified, getName, getResource, hashCode, isDirectory, isExists, isFilesystemOnly, setDirectory, setExists, setLastModified, setName, setRefid, setSize
clone, equals, getMagicNumber, iterator, size, toLongString
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
public GZipResource()
public GZipResource(ResourceCollection other)
other
- the resource to wrap.protected java.io.InputStream wrapStream(java.io.InputStream in) throws java.io.IOException
wrapStream
in class ContentTransformingResource
in
- the stream to wrap.java.io.IOException
- if there is a problem.protected java.io.OutputStream wrapStream(java.io.OutputStream out) throws java.io.IOException
wrapStream
in class ContentTransformingResource
out
- the stream to wrap.java.io.IOException
- if there is a problem.protected java.lang.String getCompressionName()
getCompressionName
in class CompressedResource