/** * Seek to the given position on an alternate copy of the data. * * @param targetPos position to seek to * @return true if a new source is found, false otherwise */ @Override public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable)in).seekToNewSource(targetPos); }
@Override public boolean seekToNewSource(long targetPos) throws IOException { Preconditions.checkArgument(targetPos >= 0, "Cannot seek to negative offset."); checkStream(); try { boolean result = ((Seekable) in).seekToNewSource(targetPos); resetStreamOffset(targetPos); return result; } catch (ClassCastException e) { throw new UnsupportedOperationException("This stream does not support " + "seekToNewSource."); } }
@Override public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable) in).seekToNewSource(targetPos); } }
@Override public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable) in).seekToNewSource(targetPos); } }
/** * Seek to the given position on an alternate copy of the data. * * @param targetPos position to seek to * @return true if a new source is found, false otherwise */ @Override public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable)in).seekToNewSource(targetPos); }
@Override public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable) in).seekToNewSource(targetPos); } }
@Override public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable) in).seekToNewSource(targetPos); } }
/** * Seek to the given position on an alternate copy of the data. * * @param targetPos position to seek to * @return true if a new source is found, false otherwise */ @Override public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable)in).seekToNewSource(targetPos); }
@Override public boolean seekToNewSource(long targetPos) throws IOException { return seekable.seekToNewSource(targetPos); }
public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable)in).seekToNewSource(targetPos); } }
/** * Seek to the given position on an alternate copy of the data. * * @param targetPos position to seek to * @return true if a new source is found, false otherwise */ @Override public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable)in).seekToNewSource(targetPos); }
/** * Seek to the given position on an alternate copy of the data. * * @param targetPos position to seek to * @return true if a new source is found, false otherwise */ @Override public boolean seekToNewSource(long targetPos) throws IOException { return ((Seekable)in).seekToNewSource(targetPos); }
@Override public boolean seekToNewSource(long targetPos) throws IOException { return seekable.seekToNewSource(targetPos); } };
@Override public boolean seekToNewSource(long targetPos) throws IOException { return seekable.seekToNewSource(targetPos); }
@Override public boolean seekToNewSource(long targetPos) throws IOException { checkSeekable(); return ((Seekable) rawStream).seekToNewSource(targetPos); } }
@Override public boolean seekToNewSource(long targetPos) throws IOException { Preconditions.checkArgument(targetPos >= 0, "Cannot seek to negative offset."); checkStream(); try { boolean result = ((Seekable) in).seekToNewSource(targetPos); resetStreamOffset(targetPos); return result; } catch (ClassCastException e) { throw new UnsupportedOperationException("This stream does not support " + "seekToNewSource."); } }
@Override public boolean seekToNewSource(long targetPos) throws IOException { Preconditions.checkArgument(targetPos >= 0, "Cannot seek to negative offset."); checkStream(); try { boolean result = ((Seekable) in).seekToNewSource(targetPos); resetStreamOffset(targetPos); return result; } catch (ClassCastException e) { throw new UnsupportedOperationException("This stream does not support " + "seekToNewSource."); } }
@Override public boolean seekToNewSource(long targetPos) throws IOException { Preconditions.checkArgument(targetPos >= 0, "Cannot seek to negative offset."); checkStream(); try { boolean result = ((Seekable) in).seekToNewSource(targetPos); resetStreamOffset(targetPos); return result; } catch (ClassCastException e) { throw new UnsupportedOperationException("This stream does not support " + "seekToNewSource."); } }
private void seekToNewSourceCheck(InputStream in, int targetPos) throws Exception { byte[] result = new byte[dataLen]; ((Seekable) in).seekToNewSource(targetPos); int n = readAll(in, result, 0, dataLen); Assert.assertEquals(dataLen, n + targetPos); byte[] readData = new byte[n]; System.arraycopy(result, 0, readData, 0, n); byte[] expectedData = new byte[n]; System.arraycopy(data, targetPos, expectedData, 0, n); Assert.assertArrayEquals(readData, expectedData); }
private void seekToNewSourceCheck(InputStream in, int targetPos) throws Exception { byte[] result = new byte[dataLen]; ((Seekable) in).seekToNewSource(targetPos); int n = readAll(in, result, 0, dataLen); Assert.assertEquals(dataLen, n + targetPos); byte[] readData = new byte[n]; System.arraycopy(result, 0, readData, 0, n); byte[] expectedData = new byte[n]; System.arraycopy(data, targetPos, expectedData, 0, n); Assert.assertArrayEquals(readData, expectedData); }