@Override public long getFilePointer() throws IOException { return content.getFilePointer(); }
public long getPosition() throws IOException { return rac.getFilePointer(); }
@Override public long getFilePointer() throws IOException { return content.getFilePointer(); }
@Override public long getFilePointer() throws IOException { return this.rac.getFilePointer(); }
@Override public long getFilePointer() throws IOException { return content.getFilePointer(); }
@Override public long getFilePointer() throws IOException { return content.getFilePointer(); }
public long getPosition() throws IOException { return rac.getFilePointer(); }
@Override public long getFilePointer() throws IOException { return this.rac.getFilePointer(); }
private long readLines(RandomAccessContent reader) throws IOException, FileServerConnectorException { long pos = reader.getFilePointer(); long rePos = pos; List<Byte> list = new ArrayList<>(); int num; int lines = 0; boolean throttled = false; for (; ((num = read(reader, inbuf)) != -1) && !throttled; pos = reader.getFilePointer()) { for (int i = 0; (i < num) && !throttled; ++i) { byte ch = this.inbuf[i]; if (ch == 10) { Byte[] line = new Byte[list.size()]; line = list.toArray(line); EventListener.fileUpdated(line, messageProcessor, serviceName); lines++; list.clear(); rePos = pos + (long) i + 1L; } else { list.add(ch); } if (maxLinesPerPoll != -1 && (lines > maxLinesPerPoll) && ch == 10) { throttled = true; } } } reader.seek(rePos); return rePos; }
assertEquals("fp", ra.getFilePointer(), 1); c = ra.readByte(); assertEquals(c, TEST_DATA.charAt(3)); assertEquals("fp", ra.getFilePointer(), 4); assertEquals("fp", ra.getFilePointer(), 5); c = ra.readByte(); assertEquals(c, TEST_DATA.charAt(3)); assertEquals("fp", ra.getFilePointer(), 4); assertEquals("fp", ra.getFilePointer(), 5); c = ra.readByte(); assertEquals(c, TEST_DATA.charAt(10)); assertEquals("fp", ra.getFilePointer(), 11); assertEquals("fp", ra.getFilePointer(), 12); } finally { if (file != null) {
assertEquals("fp", ra.getFilePointer(), 1); c = ra.readByte(); assertEquals(c, TEST_DATA.charAt(3)); assertEquals("fp", ra.getFilePointer(), 4); assertEquals("fp", ra.getFilePointer(), 5); c = ra.readByte(); assertEquals(c, TEST_DATA.charAt(3)); assertEquals("fp", ra.getFilePointer(), 4); assertEquals("fp", ra.getFilePointer(), 5); c = ra.readByte(); assertEquals(c, TEST_DATA.charAt(10)); assertEquals("fp", ra.getFilePointer(), 11); assertEquals("fp", ra.getFilePointer(), 12);
assertEquals("fp", ra.getFilePointer(), 1); c = ra.readByte(); assertEquals(c, TEST_DATA.charAt(3)); assertEquals("fp", ra.getFilePointer(), 4); assertEquals("fp", ra.getFilePointer(), 5); c = ra.readByte(); assertEquals(c, TEST_DATA.charAt(3)); assertEquals("fp", ra.getFilePointer(), 4); assertEquals("fp", ra.getFilePointer(), 5); c = ra.readByte(); assertEquals(c, TEST_DATA.charAt(10)); assertEquals("fp", ra.getFilePointer(), 11); assertEquals("fp", ra.getFilePointer(), 12); } finally { if (file != null) {