# Class: com.pnfsoftware.jeb.util.encoding.zip.fsr.ZipFailSafeReader

PNF Software's Zip Fail Safe Reader \(PZFSR\). This parser attempts to handle corner\-cases that fail Oracle's and Apache Common's parsers. 

 Limitations: 
 
- limited to 2Gb archives at most 
- zip64 is not supported 
- uncommon flags are not supported 
- non\-standard attributes are disregarded 
- the only compression scheme supported is DEFLATE

## Constructor: ZipFailSafeReader
- parameter: `file`, type: `java.io.File`

Description: Construct with all optional settings set to false.
parameter: file: input zip
throws: 

## Constructor: ZipFailSafeReader
- parameter: `channel`, type: `java.nio.channels.SeekableByteChannel`

Description: Construct with all optional settings set to false.
parameter: channel: input zip
throws: 

## Constructor: ZipFailSafeReader
- parameter: `file`, type: `java.io.File`
- parameter: `treatUnsupportedCompressionAsMethod`, type: `int`
- parameter: `ignoreEncryption`, type: `boolean`
- parameter: `recoveryMode`, type: `boolean`
- parameter: `doNotParseEntries`, type: `boolean`

Description: Construct a zip parser.
parameter: file: input zip
parameter: treatUnsupportedCompressionAsMethod: optional \(use \-1 to fail when an unsupported            compression method is encountered\); else, a compression method id
parameter: ignoreEncryption: optional
parameter: recoveryMode: optional; if true, the reader will attempt to recover zip entries of            truncated files, including those with incomplete Central Directory
parameter: doNotParseEntries: optional; if true, the zip entries will not be pre\-emptively parsed,            and it will be up to the user to trigger parsing through enumeration, via            [#enumerateEntries()](#enumerateEntries()) \(this will result in faster opening of large archives\)
throws: 

## Constructor: ZipFailSafeReader
- parameter: `channel`, type: `java.nio.channels.SeekableByteChannel`
- parameter: `treatUnsupportedCompressionAsMethod`, type: `int`
- parameter: `ignoreEncryption`, type: `boolean`
- parameter: `recoveryMode`, type: `boolean`
- parameter: `doNotParseEntries`, type: `boolean`

Description: Construct a zip parser.
parameter: channel: input
parameter: treatUnsupportedCompressionAsMethod: optional \(use \-1 to fail when an unsupported            compression method is encountered\); else, a compression method id
parameter: ignoreEncryption: 
parameter: recoveryMode: optional; if true, the reader will attempt to recover zip entries of            truncated files, including those with incomplete Central Directory
parameter: doNotParseEntries: optional; if true, the zip entries will not be pre\-emptively parsed,            and it will be up to the user to trigger parsing through enumeration, via            [#enumerateEntries()](#enumerateEntries()) \(this will result in faster opening of large archives\)
throws: 

## Static Field: DEFLATED
Type: `int`

Constant value: `8`

## Static Field: STORED
Type: `int`

Constant value: `0`

## Method: close


## Method: enumerateEntries
- return type: `java.lang.Iterable<com.pnfsoftware.jeb.util.encoding.zip.fsr.ZipEntry>`

Description: Get the iterable to parse and enumerate over the zip entries. This method should be called once, and once only, if the object was constructed with `doNotParseEntries=true`. Any [IOException](IOException) raised will be wrapped in a [RuntimeException](RuntimeException).
return: the iterable that will iterate and parse the zip entries

## Method: getEntries
- return type: `java.util.List<com.pnfsoftware.jeb.util.encoding.zip.fsr.ZipEntry>`

Description: Retrieve a read\-only list of the current entries. 

 This method may be called even if not all entries were enumerated \(incomplete parsing\). if so, it will return an incomplete list.
return: 

## Method: getEntry
- parameter: `filename`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.util.encoding.zip.fsr.ZipEntry`

Description: Retrieve an entry by name. 

 This method may be called even if not all entries were enumerated \(incomplete parsing\). It will fail if the entry has not been parsed yet.
parameter: filename: 
return: 

## Method: getNumberOfEntries
- return type: `int`


## Method: getOffsetAppendedData
- return type: `int`


## Method: getOffsetFirstEntry
- return type: `int`


## Method: hasAppendedData
- return type: `boolean`


## Method: hasEntry
- parameter: `filename`, type: `java.lang.String`
- return type: `boolean`

Description: Determine whether an entry exists. parsed yet. 

 This method may be called even if not all entries were enumerated \(incomplete parsing\). It will fail if the entry has not been parsed yet.
parameter: filename: 
return: 

## Method: hasPrependedData
- return type: `boolean`


## Method: isClosed
- return type: `boolean`


## Method: isTruncated
- return type: `boolean`


## Method: readData
- parameter: `filename`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.util.encoding.zip.fsr.ZipData`

Description: Read an entry's data and provide the decompressed bytes. 

 This method may be called even if not all entries were enumerated \(incomplete parsing\). It will fail if the entry has not been parsed yet.
parameter: filename: 
return: 
throws: 

## Method: readData
- parameter: `e`, type: `com.pnfsoftware.jeb.util.encoding.zip.fsr.ZipEntry`
- return type: `com.pnfsoftware.jeb.util.encoding.zip.fsr.ZipData`

Description: Read an entry's data and provide the decompressed bytes. 

 This method may be called even if not all entries were enumerated \(incomplete parsing\). It will fail if the entry has not been parsed yet.
parameter: e: 
return: 
throws: 

## Method: toString
- return type: `java.lang.String`


