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[]
bytes
private int
compressionMethod
private long
crc
private java.lang.String
path
private long
time
-
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.ZipEntry
getEntry()
java.io.InputStream
getInputStream()
java.lang.String
getPath()
java.lang.String
toString()
-
-
-
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:
getPath
in interfaceZipEntrySource
- Returns:
- path of the given entry (not
null
).
-
getEntry
public java.util.zip.ZipEntry getEntry()
- Specified by:
getEntry
in interfaceZipEntrySource
- Returns:
- meta-data of the given entry (not
null
).
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
- Specified by:
getInputStream
in interfaceZipEntrySource
- Returns:
- an input stream of the given entry
or
null
if this entry is a directory. - Throws:
java.io.IOException
- can throw getting the InputStream
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-