|
RuneHive-Game
|
Represents an archive within the Cache.
More...
Public Member Functions | |
| ByteBuffer | getData (String name) |
Returns the data within the ArchiveSector for the specified String name. | |
Static Public Member Functions | |
| static Archive | decode (ByteBuffer data) throws IOException |
Decodes the data within this Archive. | |
Private Member Functions | |
| Archive (Int2ObjectMap< ArchiveSector > sectors) | |
Constructs a new Archive with the specified Map of ArchiveSectors. | |
| Optional< ArchiveSector > | getSector (int hash) |
Retrieves an Optional<ArchiveSector> for the specified hash. | |
| Optional< ArchiveSector > | getSector (String name) |
Retrieves an Optional<ArchiveSector> for the specified name. | |
Private Attributes | |
| final Int2ObjectMap< ArchiveSector > | sectors |
A Map of ArchiveSector hashes to ArchiveSectors. | |
Represents an archive within the Cache.
An archive contains varied amounts of ArchiveSectors which contain compressed file system data.
Definition at line 25 of file Archive.java.
|
private |
Constructs a new Archive with the specified Map of ArchiveSectors.
| sectors | The Map of sectors within this archive. |
Definition at line 36 of file Archive.java.
References sectors.
Referenced by decode().
|
static |
Decodes the data within this Archive.
| data | The encoded data within this archive. |
Archive with the decoded data, never
null. | IOException | If some I/O exception occurs. |
Definition at line 48 of file Archive.java.
References Archive(), com.runehive.fs.util.ByteBufferUtil.getMedium(), sectors, and com.runehive.fs.util.CompressionUtil.unbzip2Headerless().
Referenced by com.runehive.fs.cache.FileSystem.create().
| ByteBuffer com.runehive.fs.cache.archive.Archive.getData | ( | String | name | ) |
Returns the data within the ArchiveSector for the specified String name.
| name | The name of the ArchiveSector. |
ArchiveSector or nothing, this method fails-fast if no ArchiveSector exists for the specified
name. Definition at line 113 of file Archive.java.
References com.runehive.fs.cache.archive.ArchiveSector.getData(), and getSector().
|
private |
Retrieves an Optional<ArchiveSector> for the specified hash.
| hash | The archive sectors hash. |
Definition at line 89 of file Archive.java.
References sectors.
Referenced by getData(), and getSector().
|
private |
Retrieves an Optional<ArchiveSector> for the specified name.
| name | The archive sectors name. |
Definition at line 99 of file Archive.java.
References getSector(), and com.runehive.util.StringUtils.hashArchive().
|
private |
A Map of ArchiveSector hashes to ArchiveSectors.
Definition at line 28 of file Archive.java.
Referenced by Archive(), decode(), and getSector().