public class DirectoryInputStream
extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BUFFER_SIZE |
(package private) java.io.InputStream |
current |
(package private) static int |
DATA |
(package private) java.io.ByteArrayOutputStream |
directory |
(package private) static int |
DIRECTORY |
(package private) java.io.File |
element |
(package private) int |
entries |
(package private) static java.io.InputStream |
eof |
(package private) static int |
EOF |
(package private) FileIterator |
fi |
(package private) static int |
HEADER |
(package private) java.io.File |
root |
(package private) static int |
START |
(package private) int |
state |
(package private) long |
where |
Constructor and Description |
---|
DirectoryInputStream(java.io.File dir) |
Modifier and Type | Method and Description |
---|---|
private java.util.zip.CRC32 |
getCRC(java.io.File file) |
(package private) java.io.InputStream |
getDirectory()
end of central dir signature 4 bytes (0x06054b50) number of this
disk 2 bytes number of the disk with the start of the central directory 2
bytes total number of entries in the central directory on this disk 2
bytes total number of entries in the central directory 2 bytes size of
the central directory 4 bytes offset of start of central directory with
respect to the starting disk number 4 bytes .ZIP file comment length 2
bytes .ZIP file comment (variable size)
|
private java.io.InputStream |
getHeader(java.io.File root,
java.io.File file)
Local file header:
|
private java.lang.String |
getPath(java.io.File root,
java.io.File file) |
(package private) void |
next() |
private void |
nextHeader() |
int |
read() |
private void |
writeInt(java.io.OutputStream out,
int v) |
private void |
writeShort(java.io.OutputStream out,
int v) |
static final int BUFFER_SIZE
final java.io.File root
final FileIterator fi
java.io.File element
int entries
int state
long where
static final int START
static final int HEADER
static final int DATA
static final int DIRECTORY
static final int EOF
static final java.io.InputStream eof
java.io.ByteArrayOutputStream directory
java.io.InputStream current
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
void next() throws java.io.IOException
java.io.IOException
private void nextHeader() throws java.io.IOException
java.io.IOException
java.io.InputStream getDirectory() throws java.io.IOException
end of central dir signature 4 bytes (0x06054b50) number of this disk 2 bytes number of the disk with the start of the central directory 2 bytes total number of entries in the central directory on this disk 2 bytes total number of entries in the central directory 2 bytes size of the central directory 4 bytes offset of start of central directory with respect to the starting disk number 4 bytes .ZIP file comment length 2 bytes .ZIP file comment (variable size)
java.io.IOException
private void writeShort(java.io.OutputStream out, int v) throws java.io.IOException
java.io.IOException
private void writeInt(java.io.OutputStream out, int v) throws java.io.IOException
java.io.IOException
private java.io.InputStream getHeader(java.io.File root, java.io.File file) throws java.io.IOException
local file header signature 4 bytes (0x04034b50) version needed to extract 2 bytes general purpose bit flag 2 bytes compression method 2 bytes last mod file time 2 bytes last mod file date 2 bytes crc-32 4 bytes compressed size 4 bytes uncompressed size 4 bytes file name length 2 bytes extra field length 2 bytes file name (variable size) extra field (variable size) central file header signature 4 bytes (0x02014b50) version made by 2 bytes version needed to extract 2 bytes general purpose bit flag 2 bytes compression method 2 bytes last mod file time 2 bytes last mod file date 2 bytes crc-32 4 bytes compressed size 4 bytes uncompressed size 4 bytes file name length 2 bytes extra field length 2 bytes file comment length 2 bytes disk number start 2 bytes internal file attributes 2 bytes external file attributes 4 bytes relative offset of local header 4 bytes file name (variable size) extra field (variable size) file comment (variable size)
java.io.IOException
private java.lang.String getPath(java.io.File root, java.io.File file)
private java.util.zip.CRC32 getCRC(java.io.File file) throws java.io.IOException
java.io.IOException