@Override public long tell() throws IOException { return stream.getPos(); }
@Override public long getPos() throws IOException { return inputStream.getPos(); }
@Override public long getPos() throws IOException { try { return originalStream.getPos(); } catch (IOException e) { handleIOException(e); return 0; // silence the compiler } }
@Override public long getPos() throws IOException { return original.getPos(); }
@Override public boolean reachedEnd() throws IOException { return this.stream.getPos() >= this.splitStart + this.splitLength; }
@Override public void flatMap(Tuple3<String, Long, Long> value, Collector<String> out) throws Exception { FSDataInputStream stream = FileSystem.get(new URI(value.f0)).open(new Path(value.f0)); stream.seek(value.f1); BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); String line; try { while ((line = reader.readLine()) != null && (value.f2 == -1L || stream.getPos() <= value.f2)) { out.collect(line); } } finally { reader.close(); } } }
when(mockIn.read()).thenReturn(value); when(mockIn.read(any(byte[].class), anyInt(), anyInt())).thenReturn(11); when(mockIn.getPos()).thenReturn(inPos); when(mockIn.available()).thenReturn(available); when(mockIn.markSupported()).thenReturn(markSupported); assertEquals(bytesRead, in.read(new byte[11], 2, 5)); assertEquals(inPos, in.getPos());
public BoundedInputStream(FSDataInputStream delegate, long endOffsetExclusive) throws IOException { this.position = delegate.getPos(); this.mark = -1L; this.endOffsetExclusive = endOffsetExclusive; this.delegate = delegate; }
public BoundedInputStream(FSDataInputStream delegate, long endOffsetExclusive) throws IOException { this.position = delegate.getPos(); this.mark = -1L; this.endOffsetExclusive = endOffsetExclusive; this.delegate = delegate; }
public BoundedInputStream(FSDataInputStream delegate, long endOffsetExclusive) throws IOException { this.position = delegate.getPos(); this.mark = -1L; this.endOffsetExclusive = endOffsetExclusive; this.delegate = delegate; }
public BoundedInputStream(FSDataInputStream delegate, long endOffsetExclusive) throws IOException { this.position = delegate.getPos(); this.mark = -1L; this.endOffsetExclusive = endOffsetExclusive; this.delegate = delegate; }
@Override public long getPos() throws IOException { return inputStream.getPos(); }
@Override public long getPos() throws IOException { return inputStream.getPos(); }
@Override public long tell() throws IOException { return stream.getPos(); }
@Override public Long getCurrentState() throws IOException { return this.stream.getPos(); }
@Override public Long getCurrentState() throws IOException { return this.stream.getPos(); }
@Override public Long getCurrentState() throws IOException { return this.stream.getPos(); }
@Override public long tell() throws IOException { return stream.getPos(); }
@Override public long getPos() throws IOException { try { return originalStream.getPos(); } catch (IOException e) { handleIOException(e); return 0; // silence the compiler } }
@Override public long getPos() throws IOException { try { return originalStream.getPos(); } catch (IOException e) { handleIOException(e); return 0; // silence the compiler } }