Package java.io

Examples of java.io.Reader.skip()


        Reader in = getCharacterStream();
        try {
          try {
            long skipped = 0;
            while (pos > 0) {
              skipped = in.skip(pos);
              pos -= skipped;
            }
            return new String(ObjectConverterUtil.convertToCharArray(in, length));
          } finally {
            in.close();
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

                (LOBInputStream) getRawByteStream(), conChild);

        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

                                TypeId.CLOB_MAXWIDTH, 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

  @Test
  public void testSkip() throws IOException
  {
    Reader data = new StringReader(DATA);
    Reader reader = new LimitReader(data, 10);
    assertEquals(10, reader.skip(100));
    assertEquals(0, reader.skip(1));
  }

  @Test
  public void testClose() throws IOException
View Full Code Here

  public void testSkip() throws IOException
  {
    Reader data = new StringReader(DATA);
    Reader reader = new LimitReader(data, 10);
    assertEquals(10, reader.skip(100));
    assertEquals(0, reader.skip(1));
  }

  @Test
  public void testClose() throws IOException
  {
View Full Code Here

  public void testSkip() throws IOException
  {
    Reader r1 = new StringReader("Yellow");
    Reader r2 = new StringReader("Submarine");
    Reader reader = new ConcatReader(r1, r2);
    assertEquals("Yellow".length(), reader.skip("Yellow".length()));
    for (char c : "Submarine".toCharArray()) {
      assertEquals(c & 0xFF, reader.read());
    }
  }
View Full Code Here

        clobReader = getCharacterStream();
                long clobLength = 0;
                for (;;)
                {
                    long size = clobReader.skip(32 * 1024);
                    if (size == -1)
                        break;
                    clobLength += size;
                }
        clobReader.close();
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);

    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

    in.reset();
    assertTrue("Wrong chars", in.read() == (char) 6
        && in.read() == (char) 7);

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    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

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.