java.lang.Cloneable
, java.lang.Comparable<Resource>
, java.lang.Iterable<Resource>
, ResourceCollection
public class GZipResource extends CompressedResource
Wraps around another resource, delegates all queries to that other resource but uncompresses/compresses streams on the fly.
description, location, project
MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
Constructor | Description |
---|---|
GZipResource() |
A no-arg constructor
|
GZipResource(ResourceCollection other) |
Constructor with another resource to wrap.
|
Modifier and Type | Method | 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
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
finalize, getClass, notify, notifyAll, wait, wait, wait
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
asOptional, clone, equals, getCheckedRef, getMagicNumber, iterator, size, toLongString
isEmpty, stream
addConfigured, compareTo, dieOnCircularReference, getLastModified, getName, getResource, hashCode, isDirectory, isExists, isFilesystemOnly, setDirectory, setExists, setLastModified, setName, setRefid, setSize
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