init(strict, gf);
/** * Creates a new instance of ShapeFile. * * @param channel * The ReadableByteChannel this reader will use. * @param strict * True to make the header parsing throw Exceptions if the * version or magic number are incorrect. * @throws IOException * If problems arise. * @throws ShapefileException * If for some reason the file contains invalid records. */ public ShapefileReader(ReadableByteChannel channel, boolean strict, boolean useMemoryMapped, Lock lock) throws IOException, ShapefileException { this.channel = channel; this.useMemoryMappedBuffer=useMemoryMapped; streamLogger.open(); randomAccessEnabled = channel instanceof FileChannel; this.lock = lock; lock.lockRead(); init(strict); }
/** * Creates a new instance of ShapeFile. * * @param shapefileFiles * The ReadableByteChannel this reader will use. * @param strict * True to make the header parsing throw Exceptions if the * version or magic number are incorrect. * @throws IOException * If problems arise. * @throws ShapefileException * If for some reason the file contains invalid records. */ public ShapefileReader(ShpFiles shapefileFiles, boolean strict, boolean useMemoryMapped, GeometryFactory gf) throws IOException, ShapefileException { this.channel = shapefileFiles.getReadChannel(ShpFileType.SHP, this); this.useMemoryMappedBuffer = useMemoryMapped; streamLogger.open(); randomAccessEnabled = channel instanceof FileChannel; try { shxReader = new IndexFile(shapefileFiles, this.useMemoryMappedBuffer); } catch(Exception e) { LOGGER.log(Level.WARNING, "Could not open the .shx file, continuing " + "assuming the .shp file is not sparse", e); currentShape = UNKNOWN; } init(strict, gf); }
init(strict, gf);
init(strict, gf);