public class MpqFile
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ADJUSTED_ENCRYPTED
The Constant ADJUSTED_ENCRYPTED.
|
static int |
COMPRESSED
The Constant COMPRESSED.
|
static int |
DELETED
The Constant DELETED.
|
static int |
ENCRYPTED
The Constant ENCRYPTED.
|
static int |
EXISTS
The Constant EXISTS.
|
static int |
SINGLEUNIT
The Constant SINGLEUNIT.
|
| Constructor and Description |
|---|
MpqFile(java.nio.MappedByteBuffer buf,
BlockTable.Block b,
int sectorSize,
java.lang.String name)
Instantiates a new mpq file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
extractToFile(java.io.File f)
Extract to file.
|
void |
extractToOutputStream(java.io.OutputStream writer)
Extract to output stream.
|
int |
getBlockIndex()
Gets the block index.
|
int |
getCompSize()
Gets the comp size.
|
int |
getFlags()
Gets the flags.
|
java.lang.String |
getName()
Gets the name.
|
int |
getNormalSize()
Gets the normal size.
|
int |
getOffset()
Gets the offset.
|
void |
setBlockIndex(int blockIndex)
Sets the block index.
|
void |
setOffset(int newOffset)
Sets the offset.
|
java.lang.String |
toString() |
void |
writeFileAndBlock(BlockTable.Block newBlock,
java.nio.MappedByteBuffer writeBuffer)
Write file and block.
|
static void |
writeFileAndBlock(byte[] fileArr,
BlockTable.Block b,
java.nio.MappedByteBuffer buf,
int sectorSize)
Write file and block.
|
static void |
writeFileAndBlock(java.io.File f,
BlockTable.Block b,
java.nio.MappedByteBuffer buf,
int sectorSize)
Write file and block.
|
public static final int COMPRESSED
public static final int ENCRYPTED
public static final int SINGLEUNIT
public static final int ADJUSTED_ENCRYPTED
public static final int EXISTS
public static final int DELETED
public MpqFile(java.nio.MappedByteBuffer buf,
BlockTable.Block b,
int sectorSize,
java.lang.String name)
throws java.io.IOException,
JMpqException
buf - the bufb - the bsectorSize - the sector sizename - the namejava.io.IOException - Signals that an I/O exception has occurred.JMpqException - the j mpq exceptionpublic int getBlockIndex()
public void setBlockIndex(int blockIndex)
blockIndex - the new block indexpublic java.lang.String toString()
toString in class java.lang.Objectpublic void setOffset(int newOffset)
newOffset - the new offsetpublic int getOffset()
public int getCompSize()
public int getNormalSize()
public int getFlags()
public java.lang.String getName()
public void extractToFile(java.io.File f)
throws java.io.IOException
f - the fjava.io.IOException - Signals that an I/O exception has occurred.public void extractToOutputStream(java.io.OutputStream writer)
throws java.io.IOException
writer - the writerjava.io.IOException - Signals that an I/O exception has occurred.public void writeFileAndBlock(BlockTable.Block newBlock, java.nio.MappedByteBuffer writeBuffer)
newBlock - the new blockwriteBuffer - the write bufferpublic static void writeFileAndBlock(java.io.File f,
BlockTable.Block b,
java.nio.MappedByteBuffer buf,
int sectorSize)
f - the fb - the bbuf - the bufsectorSize - the sector sizepublic static void writeFileAndBlock(byte[] fileArr,
BlockTable.Block b,
java.nio.MappedByteBuffer buf,
int sectorSize)
fileArr - the file arrb - the bbuf - the bufsectorSize - the sector size