01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.data.vpf.io;
17:
18: import java.io.IOException;
19:
20: import org.geotools.data.vpf.ifc.VPFHeader;
21: import org.geotools.data.vpf.ifc.VPFRow;
22:
23: /**
24: * VariableIndexInputStream.java Created: Mon Feb 24 22:23:58 2003
25: *
26: * @author <a href="mailto:kobit@users.sourceforge.net">Artur Hefczyc</a>
27: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/vpf/src/main/java/org/geotools/data/vpf/io/VariableIndexInputStream.java $
28: * @version $Id: VariableIndexInputStream.java 22482 2006-10-31 02:58:00Z desruisseaux $
29: */
30: public class VariableIndexInputStream extends VPFInputStream {
31: /**
32: * Creates a new <code>VariableIndexInputStream</code> instance.
33: *
34: * @param file a <code>String</code> value
35: * @param byteOrder a <code>char</code> value
36: * @exception IOException if an error occurs
37: */
38: public VariableIndexInputStream(String file, char byteOrder)
39: throws IOException {
40: super (file, byteOrder);
41: }
42:
43: /**
44: * Describe <code>tableSize</code> method here.
45: *
46: * @return an <code>int</code> value
47: */
48: public int tableSize() {
49: return ((VariableIndexHeader) getHeader()).getEntriesNumber();
50: }
51:
52: /**
53: * Describe <code>readHeader</code> method here.
54: *
55: * @return a <code>VPFHeader</code> value
56: * @exception IOException if an error occurs
57: */
58: public VPFHeader readHeader() throws IOException {
59: return new VariableIndexHeader(readInteger(), readInteger());
60: }
61:
62: /**
63: * Describe <code>readRow</code> method here.
64: *
65: * @return a <code>VPFRow</code> value
66: * @exception IOException if an error occurs
67: */
68: public VPFRow readRow() throws IOException {
69: return new VariableIndexRow(readInteger(), readInteger());
70: }
71: }
72:
73: // VariableIndexInputStream
|