Package org.geotools.tpk
Class TPKBundle.SequentialInputFile
Object
SequentialInputFile
- Enclosing class:
- TPKBundle
This object is used to manage the bundle data file and the bundle index file. We are using the InputStream object
returned by ZipFile.getInputStream(ZipEntry) to read data from these files. The idea is to read in a forward
direction (skipping bytes appropriately) whenever possible. If the request is for an offset that is "behind" our
current position the object will close the current InputStream, get a "new" one and satisfy the read request.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
read
(long offset, int length) At a given offset read a given number of bytes and returned them as a new byte array
-
Method Details
-
read
public byte[] read(long offset, int length) At a given offset read a given number of bytes and returned them as a new byte array- Parameters:
offset
- -- where in the stream to start readinglength
- -- how many bytes to read- Returns:
- -- a byte array of "length" bytes
-