本文整理汇总了Java中java.util.zip.CheckedInputStream.skip方法的典型用法代码示例。如果您正苦于以下问题:Java CheckedInputStream.skip方法的具体用法?Java CheckedInputStream.skip怎么用?Java CheckedInputStream.skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.zip.CheckedInputStream
的用法示例。
在下文中一共展示了CheckedInputStream.skip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_skipJ
import java.util.zip.CheckedInputStream; //导入方法依赖的package包/类
/**
* @tests java.util.zip.CheckedInputStream#skip(long)
*/
public void test_skipJ() throws Exception {
// testing that the return by skip is valid
InputStream checkInput = Support_Resources.getStream("hyts_checkInput.txt");
CheckedInputStream checkIn = new CheckedInputStream(checkInput, new CRC32());
long skipValue = 5;
assertEquals("the value returned by skip(n) is not the same as its parameter",
skipValue, checkIn.skip(skipValue));
checkIn.skip(skipValue);
// ran JDK and found the checkSum value is 2235765342
// System.out.print(checkIn.getChecksum().getValue());
assertEquals("checkSum value is not correct", 2235765342L, checkIn.getChecksum()
.getValue());
assertEquals(0, checkIn.skip(0));
checkInput.close();
}
示例2: test_skipJ
import java.util.zip.CheckedInputStream; //导入方法依赖的package包/类
/**
* @tests java.util.zip.CheckedInputStream#skip(long)
*/
public void test_skipJ() throws Exception {
// testing that the return by skip is valid
InputStream checkInput = Support_Resources.getStream("hyts_checkInput.txt");
CheckedInputStream checkIn = new CheckedInputStream(checkInput, new CRC32());
long skipValue = 5;
assertEquals("the value returned by skip(n) is not the same as its parameter",
skipValue, checkIn.skip(skipValue));
checkIn.skip(skipValue);
// ran JDK and found the checkSum value is 2235765342
// System.out.print(checkIn.getChecksum().getValue());
assertEquals("checkSum value is not correct", 2235765342L, checkIn.getChecksum()
.getValue());
checkInput.close();
}