Package java.io

Examples of java.io.StringReader.reset()


                reader = new StringReader(headerValue);
                // get the first character to decide - expect '(' or '<'
                try {
                    reader.mark(1);
                    firstChar = readWhiteSpace(reader);
                    reader.reset();
                } catch (IOException ignore) {
                    // may be thrown according to API but is only thrown by the
                    // StringReader class if the reader is already closed.
                }
View Full Code Here


                reader = new StringReader(headerValue);
                // get the first character to decide - expect '(' or '<'
                try {
                    reader.mark(1);
                    firstChar = readWhiteSpace(reader);
                    reader.reset();
                } catch (IOException ignore) {
                    // may be thrown according to API but is only thrown by the
                    // StringReader class if the reader is already closed.
                }
View Full Code Here

        throws SQLException {
    Reader clobInput = new StringReader(clobData);
        PreparedStatement pStmt =
            con.prepareStatement("update BLOBCLOB set CLOBDATA = ? where ID = ?");
        try {
            clobInput.reset();
        } catch (IOException ioe) {
            fail("Failed to reset clob input stream: " + ioe.getMessage());
        }
        pStmt.setClob(1, clobInput, clobData.length());
        pStmt.setInt(2, ID_SAMPLEVALUES);
View Full Code Here

      assertEquals("", tokenizer.parse(input, null));
      assertEquals("", tokenizer.parse(input, null));
      assertEquals("ghi", tokenizer.parse(input, null));
      assertNull(tokenizer.parse(input, null));

      input.reset();
      tokenizer = new SQLSubstReader.SQLDelimTokenizer(true)
      {
         protected boolean isDelimiter(char ch)
         {
            return Character.isWhitespace(ch);
View Full Code Here

         reader = new StringReader(m_sEnc3);
         ostream = new ByteArrayOutputStream();
         assertEquals(8, Base64Util.decode(reader, ostream, -1, false));
         assertTrue(Binary.compare(m_data3, ostream.toByteArray()) == 0);
        
         reader.reset();
         ostream = new ByteArrayOutputStream();
         assertEquals(7, Base64Util.decode(reader, ostream, 7, false));
         assertTrue(Binary.compare(m_data2, ostream.toByteArray()) == 0);

         reader.reset();
View Full Code Here

         reader.reset();
         ostream = new ByteArrayOutputStream();
         assertEquals(7, Base64Util.decode(reader, ostream, 7, false));
         assertTrue(Binary.compare(m_data2, ostream.toByteArray()) == 0);

         reader.reset();
         ostream = new ByteArrayOutputStream();
         assertEquals(6, Base64Util.decode(reader, ostream, 6, false));
         assertTrue(Binary.compare(m_data1, ostream.toByteArray()) == 0);
         reader.reset();
        
View Full Code Here

         reader.reset();
         ostream = new ByteArrayOutputStream();
         assertEquals(6, Base64Util.decode(reader, ostream, 6, false));
         assertTrue(Binary.compare(m_data1, ostream.toByteArray()) == 0);
         reader.reset();
        
         try
         {
            reader = new StringReader("A");
            ostream = new ByteArrayOutputStream();
View Full Code Here

         i++;
      }

      assertEquals(-1, reader.read());

      srcReader.reset();
      reader = new UnlimitedMarkReader(srcReader);


      // Read bytewise via character arrays
      i = 0;
View Full Code Here

         i++;
      }

      assertEquals(-1, reader.read(chArray, 0, 1));

      srcReader.reset();
      reader = new UnlimitedMarkReader(srcReader);


      // Read it all via character arrays
      chArray = new char[16];
View Full Code Here

      assertEquals(16, reader.read(chArray, 0, 16));
      assertEquals(-1, reader.read(chArray, 0, 1));
      assertEquals(sData, new String(chArray));

      srcReader.reset();
      reader = new UnlimitedMarkReader(srcReader);


      // Read more than all via character arrays
      chArray = new char[32];
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.