/** * Skips over a given amount of bytes in the stream. * * @param bytes the number of bytes to skip. * @throws IOException */ public void skipFully(long bytes) throws IOException { while (bytes > 0) { bytes -= fsDataInputStream.skip(bytes); } } }
@Override public long skip(long n) throws IOException { return fsDataInputStream.skip(n); }
private void seekToNextKeyBuffer() throws IOException { if (!keyInit) { return; } if (!currentValue.inited) { in.skip(currentRecordLength - currentKeyLength); } }
private void seekToNextKeyBuffer() throws IOException { if (!keyInit) { return; } if (!currentValue.inited) { in.skip(currentRecordLength - currentKeyLength); } }
@Override public long skip(long n) throws IOException { long skipped; try { skipped = in.skip(n); } catch (FileNotFoundException e) { skipped = tryOpen().skip(n); } catch (NullPointerException e) { // HDFS 1.x - DFSInputStream.getBlockAt() skipped = tryOpen().skip(n); } catch (AssertionError e) { // assert in HDFS 1.x - DFSInputStream.getBlockAt() skipped = tryOpen().skip(n); } if (skipped > 0) pos += skipped; return skipped; }
/** * Skips over and discards <code>n</code> bytes of data from the * input stream. * *The <code>skip</code> method skips over some smaller number of bytes * when reaching end of file before <code>n</code> bytes have been skipped. * The actual number of bytes skipped is returned. If <code>n</code> is * negative, no bytes are skipped. * * @param n the number of bytes to be skipped. * @return the actual number of bytes skipped. * @exception IOException if an I/O error occurs. * ChecksumException if the chunk to skip to is corrupted */ @Override public synchronized long skip(long n) throws IOException { long curPos = getPos(); long fileLength = getFileLength(); if( n+curPos > fileLength ) { n = fileLength - curPos; } return super.skip(n); }
/** {@inheritDoc} */ @Override public synchronized long skip(long n) throws IOException { readStart(); long res; try { res = is.skip(n); } finally { readEnd(); } if (clientLog.isLogEnabled()) clientLog.logSkip(logStreamId, res); return res; }
private void seekAndAssert(long seekPos) throws IOException { Assert.assertEquals(verifyInputStream.getPos(), testInputStream.getPos()); long delta = seekPos - testInputStream.getPos(); testInputStream.seek(seekPos); if (delta > 0L && delta <= HadoopDataInputStream.MIN_SKIP_BYTES) { verify(verifyInputStream, atLeastOnce()).skip(anyLong()); verify(verifyInputStream, never()).seek(anyLong()); } else if (delta != 0L) { verify(verifyInputStream, atLeastOnce()).seek(seekPos); verify(verifyInputStream, never()).skip(anyLong()); } else { verify(verifyInputStream, never()).seek(anyLong()); verify(verifyInputStream, never()).skip(anyLong()); } Assert.assertEquals(seekPos, verifyInputStream.getPos()); reset(verifyInputStream); }
public void skip(int numBytes) throws IOException { input.skip(numBytes); }
@Override public long skip(long n) throws IOException { return fsDataInputStream.skip(n); }
/** * Skips over a given amount of bytes in the stream. * * @param bytes the number of bytes to skip. * @throws IOException */ public void skipFully(long bytes) throws IOException { while (bytes > 0) { bytes -= fsDataInputStream.skip(bytes); } } }
/** * Skips over a given amount of bytes in the stream. * * @param bytes the number of bytes to skip. * @throws IOException */ public void skipFully(long bytes) throws IOException { while (bytes > 0) { bytes -= fsDataInputStream.skip(bytes); } } }
private void seekToNextKeyBuffer() throws IOException { if (!keyInit) { return; } if (!currentValue.inited) { in.skip(currentRecordLength - currentKeyLength); } }
private void seekToNextKeyBuffer() throws IOException { if (!keyInit) { return; } if (!currentValue.inited) { in.skip(currentRecordLength - currentKeyLength); } }
@Override public long skip(long n) throws IOException { try { return underlyingIs.skip(n); } catch(FSError e) { throw FileSystemWrapper.propagateFSError(e); } }
@Override public long skip(long n) throws IOException { try { return is.skip(n); } catch(FSError e) { throw FileSystemWrapper.propagateFSError(e); } }
@Override public Long call() throws Exception { return inputStream.skip(1); } }
@Override public Long call() throws Exception { return inputStream.skip(1); } }
@Override public Long call() throws Exception { return inputStream.skip(1); } }
private void testSkip1(int skippedBytes) throws Exception { long oldPos = stm.getPos(); long nSkipped = stm.skip(skippedBytes); long newPos = oldPos+nSkipped; assertEquals(stm.getPos(), newPos); stm.readFully(actual); checkAndEraseData(actual, (int)newPos, expected, "Read Sanity Test"); }