Package java.io

Examples of java.io.CharArrayWriter.toCharArray()


    if ( stream == null ) return toExternalFormat( null );
    CharArrayWriter writer = new CharArrayWriter();
    for(;;) {
      try {
        int c = stream.read();
        if ( c == -1) return toExternalFormat( writer.toCharArray() );
        writer.write( c );
      }
      catch (IOException e) {
        throw new HibernateException("Unable to read character stream from rs");
      }
View Full Code Here


                i = i + 2;
            } else {
                caw.write(chars[i]);
            }
        }
        return caw.toCharArray();
    }

    public static char[] escapeQuotes (char []chars) {
        // Prescan to convert %\> to %>
        String s = new String(chars);
View Full Code Here

                caw.write('>');
                i = i + 3;
            }
            else caw.write(chars[i]);
        }
        return caw.toCharArray();
    }

    public static char[] escapeQuotes (char []chars) {
        // Prescan to convert %\> to %>
        String s = new String(chars);
View Full Code Here

                i = i + 2;
            } else {
                caw.write(chars[i]);
            }
        }
        return caw.toCharArray();
    }

    public static char[] escapeQuotes (char []chars) {
        // Prescan to convert %\> to %>
        String s = new String(chars);
View Full Code Here

                decoded.write(value.charAt(i));
            }
        }

        // Now turn the chars into bytes
        char[] chars = decoded.toCharArray();
        byte[] bytes;
        if ("unicodeLE".equals(type)) {
            bytes = new byte[chars.length * 2];
            for (int i = 0; i < chars.length; i++) {
                bytes[i * 2] = (byte) (chars[i] & 0xff);
View Full Code Here

      char buf[] = new char[1024];
      for (int i = 0 ; (i = reader.read(buf)) != -1 ;)
    caw.write(buf, 0, i);
      caw.close();
      if (current == null) {
    current = new Mark(this, caw.toCharArray(), fileid,
           getFile(fileid), master, encoding);
      } else {
    current.pushStream(caw.toCharArray(), fileid, getFile(fileid),
           longName, encoding);
      }
View Full Code Here

      caw.close();
      if (current == null) {
    current = new Mark(this, caw.toCharArray(), fileid,
           getFile(fileid), master, encoding);
      } else {
    current.pushStream(caw.toCharArray(), fileid, getFile(fileid),
           longName, encoding);
      }
  } catch (Throwable ex) {
      log.error("Exception parsing file ", ex);
      // Pop state being constructed:
View Full Code Here

     * @since Commons IO 1.1
     */
    public static char[] toCharArray(InputStream is) throws IOException {
        CharArrayWriter output = new CharArrayWriter();
        copy(is, output);
        return output.toCharArray();
    }

    /**
     * Get the contents of an <code>InputStream</code> as a character array
     * using the specified character encoding.
View Full Code Here

     */
    public static char[] toCharArray(InputStream is, String encoding)
            throws IOException {
        CharArrayWriter output = new CharArrayWriter();
        copy(is, output, encoding);
        return output.toCharArray();
    }

    /**
     * Get the contents of a <code>Reader</code> as a character array.
     * <p>
 
View Full Code Here

     * @since Commons IO 1.1
     */
    public static char[] toCharArray(Reader input) throws IOException {
        CharArrayWriter sw = new CharArrayWriter();
        copy(input, sw);
        return sw.toCharArray();
    }

    // read toString
    //-----------------------------------------------------------------------
    /**
 
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.