Package java.io

Examples of java.io.CharArrayWriter.toCharArray()


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

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


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

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

    // capture the output of the XMLWriter
    final CharArrayWriter w = new CharArrayWriter();
    XMLWriter.writeResponse(w,request,response);
   
    // and write transformed result to our writer
    final Reader r = new BufferedReader(new CharArrayReader(w.toCharArray()));
    final StreamSource source = new StreamSource(r);
    final StreamResult result = new StreamResult(writer);
    try {
      t.transform(source, result);
    } catch(TransformerException te) {
View Full Code Here

        barr.write(byteValue);
        tail = list.tail();
      }

      return new EBigString(barr.toCharArray(), 0);
    }
  }

  @Override
  public int hashCode() {
View Full Code Here

      }
    } catch (IOException ex) {
      throw new HgAuthFailedException("Failed to read private key", ex);
    }
    try {
      boolean success = conn.authenticateWithPublicKey(username, a.toCharArray(), passphrase);
      if (!success) {
        throw authFailed(username);
      }
    } catch (IOException ex) {
      throw commFailed(ex);
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();
                        }
                    } finally {
                        in.close();
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

            catch ( IOException ioe )
            {
            }
        }

        char[] isca = writer.toCharArray();
        return isca;
    }


    public static byte[] getBytesFromResource( String resource ) throws IOException
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

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.