/** Returns the byte position at the beginning of the next line. */ @Override public long getPosition() { final Tuple<String, Long> peek = peek(); // Be careful: peek will be null at the end of the stream. return peek != null ? peek.b : asciiLineReader.getPosition(); } }
/** Returns the byte position at the beginning of the next line. */ @Override public long getPosition() { final Tuple<String, Long> peek = peek(); // Be careful: peek will be null at the end of the stream. return peek != null ? peek.b : asciiLineReader.getPosition(); } }
/** Returns the byte position at the beginning of the next line. */ @Override public long getPosition() { final Tuple<String, Long> peek = peek(); // Be careful: peek will be null at the end of the stream. return peek != null ? peek.b : asciiLineReader.getPosition(); } }
@Override protected Tuple<String, Long> advance() { final String line; final long position = asciiLineReader.getPosition(); // A line's position is where it starts, so get it before reading the line. try { line = asciiLineReader.readLine(); } catch (IOException e) { throw new RuntimeException(e); } return line == null ? null : new Tuple<String, Long>(line, position); }
@Override protected Tuple<String, Long> advance() { final String line; final long position = asciiLineReader.getPosition(); // A line's position is where it starts, so get it before reading the line. try { line = asciiLineReader.readLine(); } catch (IOException e) { throw new RuntimeIOException(e); } return line == null ? null : new Tuple<String, Long>(line, position); }
@Override protected Tuple<String, Long> advance() { final String line; final long position = asciiLineReader.getPosition(); // A line's position is where it starts, so get it before reading the line. try { line = asciiLineReader.readLine(); } catch (IOException e) { throw new RuntimeIOException(e); } return line == null ? null : new Tuple<String, Long>(line, position); }
location = reader.getPosition(); size = 0; basesPerLine = -1; } else { basesThisLine = line.length(); bytesThisLine = (int) (reader.getPosition() - lastPosition); lastPosition = reader.getPosition();
while (nSkip-- > 0 && reader.readLine() != null) { long startPos = reader.getPosition(); double bytesPerLine = (double) ((reader.getPosition() - startPos) / lines); int nLines = (int) (fileLength / bytesPerLine); return nLines;
lastOffset = reader.getPosition(); intervalStart = start;
/** * Returns either 1 or 2, representing the number of * bytes used to end a line. Reads only from first line of a file * * @param filePath * @return * @throws IOException */ public static int getBytesAtEnd(String filePath) throws IOException { InputStream is = new FileInputStream(filePath); AsciiLineReader reader = new AsciiLineReader(is); String line = reader.readLine(); int bytesThisLine = (int) reader.getPosition(); reader.close(); return bytesThisLine - line.length(); }
lastFilePosition = reader.getPosition();
gData.getFileIndex().add((int) reader.getPosition()); indexCounter = 0;
long location = in.getPosition(); } else if (line != null && line.charAt(0) == '>') { location = in.getPosition(); } else if (line != null && !line.isEmpty()) {
long location = in.getPosition(); } else if (line != null && line.charAt(0) == '>') { location = in.getPosition(); } else if (line != null && !line.isEmpty()) {
lastPosition = reader.getPosition();