Package java.io

Examples of java.io.CharArrayWriter.toCharArray()


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

  // read toString
  // -----------------------------------------------------------------------
  /**
 
View Full Code Here


          i++;
        }
        while ((i < s.length()) && !dontNeedEncoding.get((c = s.charAt(i))));

        charArrayWriter.flush();
        String str = new String(charArrayWriter.toCharArray());
        byte[] ba;
        try
        {
          ba = str.getBytes(charset.name());
        }
View Full Code Here

                                    }
                                }
                            }
                        }

                        delegate = new CharArrayReader(writer.toCharArray());
                    } finally {
                        in.close();
                    }
                }
            };
View Full Code Here

                            PDFTextStripper stripper = new PDFTextStripper();
                            stripper.setLineSeparator("\n");
                            stripper.writeText(document, writer);

                            delegate = new CharArrayReader(writer.toCharArray());
                        } finally {
                            document.close();
                        }
                    } catch (Exception e) {
                        // it may happen that PDFParser throws a runtime
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

    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

         else
         {
            out.write(c);
         }
      }
      return new String(out.toCharArray());
   }

   /**
    * Does a URL decoding of the <code>string</code>. Please note that in opposite to the
    * {@link java.net.URLDecoder} it does not transform the + into spaces.
View Full Code Here

    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

    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

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.