当前位置: 首页>>代码示例>>Java>>正文


Java CheckedInputStream.skip方法代码示例

本文整理汇总了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();
   }
 
开发者ID:shannah,项目名称:cn1,代码行数:19,代码来源:CheckedInputStreamTest.java

示例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();
   }
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:18,代码来源:CheckedInputStreamTest.java


注:本文中的java.util.zip.CheckedInputStream.skip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。