All Packages Class Hierarchy This Package Previous Next Index
Class blackmane.quake2.pak.Quake2PakWriter
java.lang.Object
|
+----blackmane.quake2.pak.Quake2PakWriter
- public class Quake2PakWriter
- extends Object
-
directory
-
-
header
-
-
Quake2PakWriter(String, String[], String[])
- This creates the header and directory structures, but doesn't
actually write out the file yet - don't know why, just felt like doing it that way.
-
create()
- Creates the pak file from scratch.
-
NameToQuakeName(String)
- Used to convert a String into an array of bytes after
converting all instances of \ into /.
header
protected Quake2PakHeader header
directory
protected Quake2PakDirectoryEntry directory[]
Quake2PakWriter
public Quake2PakWriter(String name,
String inputFiles[],
String internalNames[]) throws IOException
- This creates the header and directory structures, but doesn't
actually write out the file yet - don't know why, just felt like doing it that way.
This will work out the
header
and the directory
array
and have the information correct, with the directory set to be written out at the
end of the pak file.
- Parameters:
- name - the name of the pak file to create;
- inputFiles - the list of directory+path files that will be put into the pak file;
- internalNames - the list of names that the real names will appear as in the pak file
- Throws: IOException
- if there is a problem opening one of the specified files in inputFiles.
NameToQuakeName
public static byte[] NameToQuakeName(String name)
- Used to convert a String into an array of bytes after
converting all instances of \ into /. This is because quake
uses / as a separator and java may use a \ (platform decides).
- Parameters:
- name - the name to convert to quake2 format.
- Returns:
- an array of bytes (56 bytes in length) that are used for the internal name
create
public void create() throws IOException
- Creates the pak file from scratch. This will overwrite any existing file
of the same name, and will create any parent directories necessary.
- Throws: IOException
- if an error occurs accessing a file or reading a file
All Packages Class Hierarchy This Package Previous Next Index