Package org.zeroturnaround.zip
Class ByteSource
- java.lang.Object
-
- org.zeroturnaround.zip.ByteSource
-
- All Implemented Interfaces:
ZipEntrySource
public class ByteSource extends java.lang.Object implements ZipEntrySource
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bytesprivate intcompressionMethodprivate longcrcprivate java.lang.Stringpathprivate longtime
-
Constructor Summary
Constructors Constructor Description ByteSource(java.lang.String path, byte[] bytes)ByteSource(java.lang.String path, byte[] bytes, int compressionMethod)ByteSource(java.lang.String path, byte[] bytes, long time)ByteSource(java.lang.String path, byte[] bytes, long time, int compressionMethod)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.zip.ZipEntrygetEntry()java.io.InputStreamgetInputStream()java.lang.StringgetPath()java.lang.StringtoString()
-
-
-
Constructor Detail
-
ByteSource
public ByteSource(java.lang.String path, byte[] bytes)
-
ByteSource
public ByteSource(java.lang.String path, byte[] bytes, long time)
-
ByteSource
public ByteSource(java.lang.String path, byte[] bytes, int compressionMethod)
-
ByteSource
public ByteSource(java.lang.String path, byte[] bytes, long time, int compressionMethod)
-
-
Method Detail
-
getPath
public java.lang.String getPath()
- Specified by:
getPathin interfaceZipEntrySource- Returns:
- path of the given entry (not
null).
-
getEntry
public java.util.zip.ZipEntry getEntry()
- Specified by:
getEntryin interfaceZipEntrySource- Returns:
- meta-data of the given entry (not
null).
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Specified by:
getInputStreamin interfaceZipEntrySource- Returns:
- an input stream of the given entry
or
nullif this entry is a directory. - Throws:
java.io.IOException- can throw getting the InputStream
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-