RuneHive-Game
Loading...
Searching...
No Matches
ArchiveSector.java
Go to the documentation of this file.
1package com.runehive.fs.cache.archive;
2
3import com.runehive.fs.cache.FileSystem;
4
5import java.nio.ByteBuffer;
6
7/**
8 * Represents a sector within an {@link Archive}. <p> A archive sector contains
9 * a hashed name and compressed data, this data represents files and information
10 * within the {@link FileSystem}. </p>
11 *
12 * @author Ryley Kimmel <ryley.kimmel@live.com>
13 */
14public final class ArchiveSector {
15
16 /** The data within this sector. */
17 private final ByteBuffer data;
18
19 /** The hashed name of this sector. */
20 private final int hash;
21
22 /**
23 * Constructs a new {@link ArchiveSector} with the specified data and hashed
24 * name.
25 *
26 * @param data The data within this sector.
27 * @param hash The hashed name of this sector.
28 */
29 protected ArchiveSector(ByteBuffer data, int hash) {
30 this.data = data;
31 this.hash = hash;
32 }
33
34 /** Returns the data within this sector. */
35 public ByteBuffer getData() {
36 return data;
37 }
38
39 /** Returns the hashed name of this sector. */
40 public int getHash() {
41 return hash;
42 }
43
44}
final ByteBuffer data
The data within this sector.
ArchiveSector(ByteBuffer data, int hash)
Constructs a new ArchiveSector with the specified data and hashed name.
final int hash
The hashed name of this sector.
ByteBuffer getData()
Returns the data within this sector.
int getHash()
Returns the hashed name of this sector.