本文整理汇总了Java中java.io.CharArrayReader.skip方法的典型用法代码示例。如果您正苦于以下问题:Java CharArrayReader.skip方法的具体用法?Java CharArrayReader.skip怎么用?Java CharArrayReader.skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.CharArrayReader
的用法示例。
在下文中一共展示了CharArrayReader.skip方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_markI
import java.io.CharArrayReader; //导入方法依赖的package包/类
/**
* java.io.CharArrayReader#mark(int)
*/
public void test_markI() throws IOException {
cr = new CharArrayReader(hw);
cr.skip(5L);
cr.mark(100);
cr.read();
cr.reset();
assertEquals("Test 1: Failed to mark correct position;",
'W', cr.read());
cr.close();
try {
cr.mark(100);
fail("Test 2: IOException expected.");
} catch (IOException e) {
// Expected.
}
}
示例2: test_reset
import java.io.CharArrayReader; //导入方法依赖的package包/类
/**
* java.io.CharArrayReader#reset()
*/
public void test_reset() throws IOException {
cr = new CharArrayReader(hw);
cr.skip(5L);
cr.mark(100);
cr.read();
cr.reset();
assertEquals("Test 1: Reset failed to return to marker position.",
'W', cr.read());
cr.close();
try {
cr.reset();
fail("Test 2: IOException expected.");
} catch (IOException e) {
// Expected.
}
}
示例3: test_skipJ
import java.io.CharArrayReader; //导入方法依赖的package包/类
public void test_skipJ() throws IOException {
long skipped = 0;
cr = new CharArrayReader(hw);
skipped = cr.skip(5L);
assertEquals("Test 1: Failed to skip correct number of chars;",
5L, skipped);
assertEquals("Test 2: Skip skipped wrong chars;",
'W', cr.read());
cr.close();
try {
cr.skip(1);
fail("Test 3: IOException expected.");
} catch (IOException e) {
// Expected.
}
}
示例4: test_markI
import java.io.CharArrayReader; //导入方法依赖的package包/类
/**
* @tests java.io.CharArrayReader#mark(int)
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "mark",
args = {int.class}
)
public void test_markI() throws IOException {
// Test for method void java.io.CharArrayReader.mark(int)
cr = new CharArrayReader(hw);
cr.skip(5L);
cr.mark(100);
cr.read();
cr.reset();
assertEquals("Test 1: Failed to mark correct position;",
'W', cr.read());
cr.close();
try {
cr.mark(100);
fail("Test 2: IOException expected.");
} catch (IOException e) {
// Expected.
}
}
示例5: test_reset
import java.io.CharArrayReader; //导入方法依赖的package包/类
/**
* @tests java.io.CharArrayReader#reset()
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "reset",
args = {}
)
public void test_reset() throws IOException {
cr = new CharArrayReader(hw);
cr.skip(5L);
cr.mark(100);
cr.read();
cr.reset();
assertEquals("Test 1: Reset failed to return to marker position.",
'W', cr.read());
cr.close();
try {
cr.reset();
fail("Test 2: IOException expected.");
} catch (IOException e) {
// Expected.
}
}
示例6: test_skipJ
import java.io.CharArrayReader; //导入方法依赖的package包/类
/**
* @tests java.io.CharArrayReader#skip(long)
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "skip",
args = {long.class}
)
public void test_skipJ() throws IOException {
long skipped = 0;
cr = new CharArrayReader(hw);
skipped = cr.skip(5L);
assertEquals("Test 1: Failed to skip correct number of chars;",
5L, skipped);
assertEquals("Test 2: Skip skipped wrong chars;",
'W', cr.read());
cr.close();
try {
cr.skip(1);
fail("Test 3: IOException expected.");
} catch (IOException e) {
// Expected.
}
}
示例7: test_markI
import java.io.CharArrayReader; //导入方法依赖的package包/类
/**
* @tests java.io.CharArrayReader#mark(int)
*/
public void test_markI() throws IOException {
cr = new CharArrayReader(hw);
cr.skip(5L);
cr.mark(100);
cr.read();
cr.reset();
assertEquals("Failed to mark correct position", 'W', cr.read());
}
示例8: test_skipJ
import java.io.CharArrayReader; //导入方法依赖的package包/类
/**
* @tests java.io.CharArrayReader#skip(long)
*/
public void test_skipJ() throws IOException {
cr = new CharArrayReader(hw);
long skipped = cr.skip(5L);
assertEquals("Failed to skip correct number of chars", 5L, skipped);
assertEquals("Skip skipped wrong chars", 'W', cr.read());
}