/** * Open a RandomAccessReader (not compressed, not mmapped, no read throttling) that will own its channel. * * @param file File to open for reading * @return new RandomAccessReader that owns the channel opened in this method. */ @SuppressWarnings("resource") public static RandomAccessReader open(File file) { ChannelProxy channel = new ChannelProxy(file); try { ChunkReader reader = new SimpleChunkReader(channel, -1, BufferType.OFF_HEAP, DEFAULT_BUFFER_SIZE); Rebufferer rebufferer = reader.instantiateRebufferer(); return new RandomAccessReaderWithOwnChannel(rebufferer); } catch (Throwable t) { channel.close(); throw t; } } }
/** * Open a RandomAccessReader (not compressed, not mmapped, no read throttling) that will own its channel. * * @param file File to open for reading * @return new RandomAccessReader that owns the channel opened in this method. */ @SuppressWarnings("resource") public static RandomAccessReader open(File file) { ChannelProxy channel = new ChannelProxy(file); try { ChunkReader reader = new SimpleChunkReader(channel, -1, BufferType.OFF_HEAP, DEFAULT_BUFFER_SIZE); Rebufferer rebufferer = reader.instantiateRebufferer(); return new RandomAccessReaderWithOwnChannel(rebufferer); } catch (Throwable t) { channel.close(); throw t; } } }
/** * Open a RandomAccessReader (not compressed, not mmapped, no read throttling) that will own its channel. * * @param file File to open for reading * @return new RandomAccessReader that owns the channel opened in this method. */ @SuppressWarnings("resource") public static RandomAccessReader open(File file) { ChannelProxy channel = new ChannelProxy(file); try { ChunkReader reader = new SimpleChunkReader(channel, -1, BufferType.OFF_HEAP, DEFAULT_BUFFER_SIZE); Rebufferer rebufferer = reader.instantiateRebufferer(); return new RandomAccessReaderWithOwnChannel(rebufferer); } catch (Throwable t) { channel.close(); throw t; } } }
/** * Open a RandomAccessReader (not compressed, not mmapped, no read throttling) that will own its channel. * * @param file File to open for reading * @return new RandomAccessReader that owns the channel opened in this method. */ @SuppressWarnings("resource") public static RandomAccessReader open(String file) { ChannelProxy channel = ChannelProxy.getInstance(file);// //new ChannelProxy(file); try { ChunkReader reader = new SimpleChunkReader(channel, -1, BufferType.ON_HEAP, DEFAULT_BUFFER_SIZE); Rebufferer rebufferer = reader.instantiateRebufferer(); return new RandomAccessReaderWithOwnChannel(rebufferer); } catch (Throwable t) { channel.close(); throw t; } } }