### Question:
IRODSFileInputStream extends InputStream { @Override public long skip(final long numberOfBytesToSkip) throws IOException { long length = availableAsLong(); if (length <= 0) { return 0; } try { openFile(); if ((filePointer + numberOfBytesToSkip) < length) { fileIOOperations.seek(fd, numberOfBytesToSkip, FileIOOperations.SeekWhenceType.SEEK_CURRENT); filePointer += numberOfBytesToSkip; return numberOfBytesToSkip; } else { fileIOOperations.seek(fd, length, FileIOOperations.SeekWhenceType.SEEK_CURRENT); filePointer += length; return length; } } catch (JargonException e) { log.error("JargonException in operation, rethrown as IOException for contract", e); throw new IOException(e); } } protected  IRODSFileInputStream(final IRODSFile irodsFile, final FileIOOperations fileIOOperations); protected  IRODSFileInputStream(final IRODSFile irodsFile, final FileIOOperations fileIOOperations, final int fd); @Override int read(); @Override int read(final byte b[], final int off, final int len); @Override int read(final byte b[]); @Override long skip(final long numberOfBytesToSkip); @Override int available(); long availableAsLong(); @Override void close();  }### Answer:
@Test public final void testSkip() throws Exception { String testFileName = "testfileskip.txt"; int fileLengthInKb = 2; long fileLengthInBytes = fileLengthInKb * 1024; String absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH); FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, fileLengthInBytes); String targetIrodsCollection = testingPropertiesHelper .buildIRODSCollectionAbsolutePathFromTestProperties(testingProperties, IRODS_TEST_SUBDIR_PATH); StringBuilder fileNameAndPath = new StringBuilder(); fileNameAndPath.append(absPath); fileNameAndPath.append(testFileName); IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); IRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory(); DataTransferOperations dto = accessObjectFactory.getDataTransferOperations(irodsAccount); dto.putOperation(fileNameAndPath.toString(), targetIrodsCollection, testingProperties.getProperty(TestingPropertiesHelper.IRODS_RESOURCE_KEY), null, null); IRODSFileFactory irodsFileFactory = accessObjectFactory.getIRODSFileFactory(irodsAccount); IRODSFile irodsFile = irodsFileFactory.instanceIRODSFile(targetIrodsCollection, testFileName); IRODSFileInputStream fis = irodsFileFactory.instanceIRODSFileInputStream(irodsFile); ByteArrayOutputStream actualFileContents = new ByteArrayOutputStream(); long skipped = fis.skip(1024L); long numberBytesReadAfterSkip = 0L; int readBytes; byte[] readBytesBuffer = new byte[512]; while ((readBytes = (fis.read(readBytesBuffer, 0, readBytesBuffer.length))) > -1) { actualFileContents.write(readBytes); numberBytesReadAfterSkip += readBytes; } Assert.assertEquals("I did not skip and then read the remainder of the specified file", fileLengthInBytes, skipped + numberBytesReadAfterSkip); }