/** Constructor for a RandomDataInput object */ public BitFileBuffered(RandomDataInput f) { file = f; buffer_size = DEFAULT_BUFFER_LENGTH; try{ fileSize = f.length(); } catch (IOException ioe) { logger.error("Input/Output exception getting file length in BitFileBuffered object.", ioe); } }
/** Constructor for a RandomDataInput object */ public BitFileBuffered(RandomDataInput f) { file = f; buffer_size = DEFAULT_BUFFER_LENGTH; try{ fileSize = f.length(); } catch (IOException ioe) { logger.error("Input/Output exception getting file length in BitFileBuffered object.", ioe); } }
public BufferedFileByteIn(RandomDataInput file, int bufferSize, long startByteOffset, ByteFileBuffered father) throws IOException { this.file = file; this.father = father; try { file.seek(startByteOffset); this.di = new BufferedDataInput(file, file.length() - startByteOffset, bufferSize); this.byteOffset = startByteOffset; } catch (IOException e) { logger.error( "Input/Output exception while reading from a random access file. Stack trace follows", e); } } }
public BufferedFileByteIn(RandomDataInput file, int bufferSize, long startByteOffset, ByteFileBuffered father) throws IOException { this.file = file; this.father = father; try { file.seek(startByteOffset); this.di = new BufferedDataInput(file, file.length() - startByteOffset, bufferSize); this.byteOffset = startByteOffset; } catch (IOException e) { logger.error( "Input/Output exception while reading from a random access file. Stack trace follows", e); } } }
/** * constructor * @param file * @param filename * @param _keyFactory * @param _valueFactory * @throws IOException */ public FSOrderedMapFile(RandomDataInput file, String filename, FixedSizeWriteableFactory<K> _keyFactory, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = file; this.dataFilename = filename; this.keyFactory = _keyFactory; this.valueFactory = _valueFactory; this.entrySize = _keyFactory.getSize() + _valueFactory.getSize(); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); this.shortcut = new DefaultMapFileBSearchShortcut<K>(); } /**
/** default constructor * * @param filename * @param updateable * @param _valueFactory * @throws IOException */ public FSArrayFile( String filename, boolean updateable, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = updateable ? Files.writeFileRandom(this.dataFilename = filename) : Files.openFileRandom(this.dataFilename = filename); this.valueFactory = _valueFactory; this.entrySize = _valueFactory.getSize(); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); }
/** default constructor * * @param filename * @param updateable * @param _valueFactory * @throws IOException */ public FSArrayFile( String filename, boolean updateable, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = updateable ? Files.writeFileRandom(this.dataFilename = filename) : Files.openFileRandom(this.dataFilename = filename); this.valueFactory = _valueFactory; this.entrySize = _valueFactory.getSize(); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); }
/** * constructor * @param file * @param filename * @param _keyFactory * @param _valueFactory * @throws IOException */ public FSOrderedMapFile(RandomDataInput file, String filename, FixedSizeWriteableFactory<K> _keyFactory, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = file; this.dataFilename = filename; this.keyFactory = _keyFactory; this.valueFactory = _valueFactory; this.entrySize = _keyFactory.getSize() + _valueFactory.getSize(); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); this.shortcut = new DefaultMapFileBSearchShortcut<K>(); } /**
/** Construct a new object to access the underlying file data structure * * @param filename Filename of the file containing the structure * @param updateable Whether the file can be updated in this JVM * @param _keyFactory factory object for keys * @param _valueFactory factory object for values * @throws IOException thrown if an IO problem occurs */ public FSOrderedMapFile( String filename, boolean updateable, FixedSizeWriteableFactory<K> _keyFactory, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = updateable ? Files.writeFileRandom(this.dataFilename = filename) : Files.openFileRandom(this.dataFilename = filename); this.keyFactory = _keyFactory; this.valueFactory = _valueFactory; this.entrySize = _keyFactory.getSize() + _valueFactory.getSize(); //System.err.println("FSOrderedMapFile entrySize is "+ this.entrySize); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); this.shortcut = new DefaultMapFileBSearchShortcut<K>(); } /**
/** Construct a new object to access the underlying file data structure * * @param filename Filename of the file containing the structure * @param updateable Whether the file can be updated in this JVM * @param _keyFactory factory object for keys * @param _valueFactory factory object for values * @throws IOException thrown if an IO problem occurs */ public FSOrderedMapFile( String filename, boolean updateable, FixedSizeWriteableFactory<K> _keyFactory, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = updateable ? Files.writeFileRandom(this.dataFilename = filename) : Files.openFileRandom(this.dataFilename = filename); this.keyFactory = _keyFactory; this.valueFactory = _valueFactory; this.entrySize = _keyFactory.getSize() + _valueFactory.getSize(); //System.err.println("FSOrderedMapFile entrySize is "+ this.entrySize); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); this.shortcut = new DefaultMapFileBSearchShortcut<K>(); } /**