當前位置: 首頁>>代碼示例>>Java>>正文


Java CharArrayReader.skip方法代碼示例

本文整理匯總了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.
    }
}
 
開發者ID:Sellegit,項目名稱:j2objc,代碼行數:21,代碼來源:OldCharArrayReaderTest.java

示例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.
    }
}
 
開發者ID:Sellegit,項目名稱:j2objc,代碼行數:21,代碼來源:OldCharArrayReaderTest.java

示例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.
    }
}
 
開發者ID:Sellegit,項目名稱:j2objc,代碼行數:18,代碼來源:OldCharArrayReaderTest.java

示例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.
    }
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:27,代碼來源:CharArrayReaderTest.java

示例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.
    }
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:26,代碼來源:CharArrayReaderTest.java

示例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.
    }
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:26,代碼來源:CharArrayReaderTest.java

示例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());
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:12,代碼來源:CharArrayReaderTest.java

示例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());
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:11,代碼來源:CharArrayReaderTest.java


注:本文中的java.io.CharArrayReader.skip方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。