Examples of toCharArray()


Examples of java.io.CharArrayWriter.toCharArray()

  public void testEncodeArrayNull() {
    try {
      CharArrayWriter writer = new CharArrayWriter();
      HTMLEncoder.encode(null, 0, 0, writer);
      assertEquals(new char[]{}, writer.toCharArray());
    } catch (IOException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

Examples of java.io.CharArrayWriter.toCharArray()

  public void testEncodeArrayWrongIndex1() {
    try {
      CharArrayWriter writer = new CharArrayWriter();
      char[] source = stringSpecialChars2.toCharArray();
      HTMLEncoder.encode(source, 0, source.length - 100, writer);
      assertEquals(new char[]{}, writer.toCharArray());
    } catch (IOException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

Examples of java.io.CharArrayWriter.toCharArray()

  public void testEncodeArrayWrongIndex2() {
    try {
      CharArrayWriter writer = new CharArrayWriter();
      char[] source = stringSpecialChars2.toCharArray();
      HTMLEncoder.encode(source, -100, source.length, writer);
      assertEquals(stringSpecialChars2Encoded.toCharArray(), writer.toCharArray());
    } catch (IOException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

Examples of java.io.CharArrayWriter.toCharArray()

  public void testEncodeArrayWrongIndex3() {
    try {
      CharArrayWriter writer = new CharArrayWriter();
      char[] source = stringSpecialChars2.toCharArray();
      HTMLEncoder.encode(source, 100000, source.length, writer);
      assertEquals(new char[]{}, writer.toCharArray());
    } catch (IOException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

Examples of java.io.CharArrayWriter.toCharArray()

  public void testEncodeArrayLineBreak1() {
    try {
      CharArrayWriter writer = new CharArrayWriter();
      char[] source = stringLineBreak.toCharArray();
      HTMLEncoder.encode(source, 0, source.length, true, writer);
      assertEquals(stringLineBreakEncoded1.toCharArray(), writer.toCharArray());
    } catch (IOException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

Examples of java.lang.String.toCharArray()

  public static void decodeXSLData(XSLFileType[] files) throws Exception {
    String returnedContent = null;
    for (int i = 0; i < files.length; i++) {
      returnedContent = files[i].getFileContent();
      if (returnedContent != null) {
        byte[] decodeOut = Base64.decode(returnedContent.toCharArray());
        String xsl = eBayUtil.convertInputStreamToString(new ByteArrayInputStream(decodeOut));
        files[i].setFileContent(xsl);
      }
    }
  }
View Full Code Here

Examples of jodd.io.FastCharArrayWriter.toCharArray()

   * Renders tag body to char array.
   */
  public static char[] renderBody(JspFragment body) throws JspException {
    FastCharArrayWriter writer = new FastCharArrayWriter();
    invokeBody(body, writer);
    return writer.toCharArray();
  }


  /**
   * Renders tag body to string.
View Full Code Here

Examples of lombok.val.toCharArray()

    val sb = new StringBuilder(length + 32);

    while (sb.length() < length)
    {
      val base64 = ConversionUtils.toBase64(getPseudoInt64());
      for (char ch : base64.toCharArray())
        if (Character.isLetterOrDigit(ch))
          sb.append(ch);
    }

    return sb.substring(0, length);
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.user.RequestState.toCharArray()

            AttributesImpl attr = new AttributesImpl();
            consumer.startElement("", PortalConstants.ELEMENT_ADMINCONF, PortalConstants.ELEMENT_ADMINCONF, attr);

            context.setAttribute(ATTRIBUTE_ADMIN_STATE, state);
            consumer.startElement("", PortalConstants.ELEMENT_STATE, PortalConstants.ELEMENT_STATE, attr);
            consumer.characters(state.toCharArray(), 0, state.length());
            consumer.endElement("", PortalConstants.ELEMENT_STATE, PortalConstants.ELEMENT_STATE);

            if (state.equals(PortalConstants.STATE_MAIN) ) {

                Document rolesDF = this.getRoles();
View Full Code Here

Examples of org.apache.http.io.CharArrayBuffer.toCharArray()

   
    public void testSimpleAppend() throws Exception {
      CharArrayBuffer buffer = new CharArrayBuffer(16);
      assertEquals(16, buffer.capacity());
      assertEquals(0, buffer.length());
      char[] b1 = buffer.toCharArray();
      assertNotNull(b1);
      assertEquals(0, b1.length);
      assertTrue(buffer.isEmpty());
        assertFalse(buffer.isFull());
     
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.