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: * SpatialIndexInputStream.java Created: Mon Feb 24 22:25:15 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/SpatialIndexInputStream.java $
28: * @version $Id: SpatialIndexInputStream.java 22482 2006-10-31 02:58:00Z desruisseaux $
29: */
30: public class SpatialIndexInputStream extends VPFInputStream {
31: /** Variable constant <code>SPATIAL_INDEX_ROW_SIZE</code> keeps value of */
32: public static final long SPATIAL_INDEX_ROW_SIZE = 8;
33:
34: /**
35: * Creates a new <code>SpatialIndexInputStream</code> instance.
36: *
37: * @param file a <code>String</code> value
38: * @param byteOrder a <code>char</code> value
39: *
40: * @exception IOException if an error occurs
41: */
42: public SpatialIndexInputStream(String file, char byteOrder)
43: throws IOException {
44: super (file, byteOrder);
45: }
46:
47: /**
48: * Describe <code>tableSize</code> method here.
49: *
50: * @return an <code>int</code> value
51: */
52: public int tableSize() {
53: return -1;
54: }
55:
56: /**
57: * Describe <code>readHeader</code> method here.
58: *
59: * @return a <code>VPFHeader</code> value
60: *
61: * @exception IOException if an error occurs
62: */
63: public VPFHeader readHeader() throws IOException {
64: return new SpatialIndexHeader(readInteger(), readFloat(),
65: readFloat(), readFloat(), readFloat(), readInteger());
66: }
67:
68: /**
69: * Describe <code>readRow</code> method here.
70: *
71: * @return a <code>VPFRow</code> value
72: *
73: * @exception IOException if an error occurs
74: */
75: public VPFRow readRow() throws IOException {
76: return null;
77: }
78:
79: /**
80: * Describe <code>setPosition</code> method here.
81: *
82: * @param pos a <code>long</code> value
83: *
84: * @exception IOException if an error occurs
85: */
86: public void setPosition(long pos) throws IOException {
87: seek(SPATIAL_INDEX_ROW_SIZE * pos);
88: }
89: }
|