public class McRegionReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
CHUNK_HEADER_SIZE |
protected java.io.DataInputStream |
dataStream |
protected int[] |
offsets |
protected static int |
SECTOR_BYTES |
protected static int |
SECTOR_INTS |
protected ForwardSeekableInputStream |
stream |
protected static int |
VERSION_DEFLATE |
protected static int |
VERSION_GZIP |
Constructor and Description |
---|
McRegionReader(java.io.InputStream stream)
Construct the reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the stream.
|
java.io.InputStream |
getChunkInputStream(BlockVector2 position)
Gets the uncompressed data input stream for a chunk.
|
boolean |
hasChunk(int x,
int z)
Returns whether the file contains a chunk.
|
protected static final int VERSION_GZIP
protected static final int VERSION_DEFLATE
protected static final int SECTOR_BYTES
protected static final int SECTOR_INTS
public static final int CHUNK_HEADER_SIZE
protected ForwardSeekableInputStream stream
protected java.io.DataInputStream dataStream
protected int[] offsets
public McRegionReader(java.io.InputStream stream) throws java.io.IOException
stream
- the streamjava.io.IOException
- if there is an error getting the region datapublic java.io.InputStream getChunkInputStream(BlockVector2 position) throws java.io.IOException, DataException
position
- chunk positionjava.io.IOException
- if there is an error getting the chunk dataDataException
- if there is an error getting the chunk datapublic boolean hasChunk(int x, int z)
x
- the X coordinatez
- the Z coordinatepublic void close() throws java.io.IOException
java.io.IOException