Package java.io

Examples of java.io.Reader.skip()


                }
                else
                {
                    // from file using offset
                    sourceReader = workspace.getFileSpecification(sourcePath).createReader();
                    sourceReader.skip(openT.getLocalEnd());
                }

                assert !anyNonParametersInScope(contents);
               
                // rebuild function body AST
View Full Code Here


                conChild.getConnectionSynchronization());

        long leftToSkip = pos -1;
        long skipped;
        while (leftToSkip > 0) {
            skipped = isr.skip(leftToSkip);
            // Since Reader.skip block until some characters are available,
            // a return value of 0 must mean EOF.
            if (skipped <= 0) {
                throw new EOFException("Reached end-of-stream prematurely");
            }
View Full Code Here

        Reader reader = new UTF8Reader(
                csd, this.conChild, this.synchronizationObject);
        long leftToSkip = pos -1;
        long skipped;
        while (leftToSkip > 0) {
            skipped = reader.skip(leftToSkip);
            // Since Reader.skip block until some characters are available,
            // a return value of 0 must mean EOF.
            if (skipped <= 0) {
                throw new EOFException("Reached end-of-stream prematurely");
            }
View Full Code Here

            long left = pos - 1;
            long skipped = 0;
            if (clobLength > 0) {
                println("clobLength: " + clobLength);
                while (left > 0 && skipped >= 0) {
                    skipped = reader.skip(Math.min(1024, left));
                    left -= skipped > 0 ? skipped : 0;
                }
            }
            int numBytes = reader.read(value);
View Full Code Here

        assertEquals('K', r.read());
        long length = 1;
        while (true) {
            // Since we're skipping characters, the bytes have to be decoded
            // and we will detect any encoding errors.
            long skipped = r.skip(4096);
            if (skipped > 0) {
                length += skipped;
            } else {
                break;
            }
View Full Code Here

    for (int i = 0; i < 256; i++)
      chars[i] = (char) i;
    Reader in = new BufferedReader(new Support_StringReader(new String(
        chars)), 12);
    try {
      in.skip(6);
      in.mark(14);
      in.read(new char[14], 0, 14);
      in.reset();
      assertTrue("Wrong chars", in.read() == (char) 6
          && in.read() == (char) 7);
View Full Code Here

      fail("Exception during mark test 2:" + e);
    }

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    try {
      in.skip(6);
      in.mark(8);
      in.skip(7);
      in.reset();
      assertTrue("Wrong chars 2", in.read() == (char) 6
          && in.read() == (char) 7);
View Full Code Here

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    try {
      in.skip(6);
      in.mark(8);
      in.skip(7);
      in.reset();
      assertTrue("Wrong chars 2", in.read() == (char) 6
          && in.read() == (char) 7);
    } catch (IOException e) {
      fail("Exception during mark test 3:" + e);
View Full Code Here

        assertEquals(9, reader.read(buf));
        assertEquals("some text", new String(buf, 0, 9));
       
        assertEquals(-1, reader.read());
        assertEquals(false, reader.ready());
        assertEquals(0, reader.skip(2));
        assertEquals(0, reader.skip(-1));
       
        assertEquals(true, reader.markSupported());
        reader = sb.asReader();
        assertEquals('s', reader.read());
View Full Code Here

        assertEquals("some text", new String(buf, 0, 9));
       
        assertEquals(-1, reader.read());
        assertEquals(false, reader.ready());
        assertEquals(0, reader.skip(2));
        assertEquals(0, reader.skip(-1));
       
        assertEquals(true, reader.markSupported());
        reader = sb.asReader();
        assertEquals('s', reader.read());
        reader.mark(-1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.