Examples of CodePointBuffer


Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

  {
  }

  public void testGraphemeClusterGenerationWindows()
  {
    CodePointBuffer buffer = Utf16LE.getInstance().decodeString("T\r\n\r\n\r\nT", null); //$NON-NLS-1$
    final int[] data = buffer.getBuffer();
    final boolean[] result = new boolean[]
    {
        true, true, false, true, false, true, false, true
    };
    GraphemeClusterProducer prod = new GraphemeClusterProducer();

    for (int i = 0; i < buffer.getLength(); i++)
    {
      final int codepoint = data[i];
      if (prod.createGraphemeCluster(codepoint) != result[i])
      {
        TestCase.fail();
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

    }
  }

  public void testGraphemeClusterGenerationUnix()
  {
    CodePointBuffer buffer = Utf16LE.getInstance().decodeString("T\n\n\nT", null); //$NON-NLS-1$
    final int[] data = buffer.getBuffer();
    final boolean[] result = new boolean[]
    {
        true, true,  true, true, true
    };
    GraphemeClusterProducer prod = new GraphemeClusterProducer();

    for (int i = 0; i < buffer.getLength(); i++)
    {
      final int codepoint = data[i];
      if (prod.createGraphemeCluster(codepoint) != result[i])
      {
        TestCase.fail();
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

    }
  }

  public void testGraphemeClusterGenerationOldMac()
  {
    CodePointBuffer buffer = Utf16LE.getInstance().decodeString("T\r\r\rT", null); //$NON-NLS-1$
    final int[] data = buffer.getBuffer();
    final boolean[] result = new boolean[]
    {
        true, true, true, true, true
    };
    GraphemeClusterProducer prod = new GraphemeClusterProducer();

    for (int i = 0; i < buffer.getLength(); i++)
    {
      final int codepoint = data[i];
      if (prod.createGraphemeCluster(codepoint) != result[i])
      {
        TestCase.fail();
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

  public CodePointBuffer decode (final ByteBuffer text, CodePointBuffer buffer)
  {
    final int textLength = text.getLength();
    if (buffer == null)
    {
      buffer = new CodePointBuffer(textLength / 2);
    }
    else if ((buffer.getLength() / 2) < textLength)
    {
      buffer.ensureSize(textLength / 2);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

  public CodePointBuffer decode (final char[] chars, final int offset, final int length, CodePointBuffer buffer)
  {
    if (buffer == null)
    {
      buffer = new CodePointBuffer(length);
    }
    else if ((buffer.getLength()) < length)
    {
      buffer.ensureSize(length);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

  public CodePointBuffer decode(final ByteBuffer text, CodePointBuffer buffer)
  {
    final int textLength = text.getLength();
    if (buffer == null)
    {
      buffer = new CodePointBuffer(textLength);
    }
    else if (buffer.getLength() < textLength)
    {
      buffer.ensureSize(textLength);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

          throws EncodingException
  {
    final int textLength = text.getLength();
    if (buffer == null)
    {
      buffer = new CodePointBuffer(textLength);
    }
    else if (buffer.getLength() < textLength)
    {
      buffer.ensureSize(textLength);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

  public CodePointBuffer decode(final ByteBuffer text, CodePointBuffer buffer)
  {
    final int textLength = text.getLength();
    if (buffer == null)
    {
      buffer = new CodePointBuffer(textLength);
    }
    else if (buffer.getLength() < textLength)
    {
      buffer.ensureSize(textLength);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

          throws EncodingException
  {
    final int textLength = text.getLength();
    if (buffer == null)
    {
      buffer = new CodePointBuffer(textLength);
    }
    else if (buffer.getLength() < textLength)
    {
      buffer.ensureSize(textLength);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer

    super(string);
  }

  public void testWrite ()
  {
    final CodePointBuffer buffer = new CodePointBuffer(0);
    final CodePointStream cps = new CodePointStream(buffer, 10);
    cps.put(10);
    cps.put(11);
    cps.put(12);
    cps.put(13);

    cps.put(new int[]{20, 21, 22, 23, 24, 25});
    cps.close();

    assertEquals("Buffer-Cursor: ", 10, buffer.getCursor());
  }
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.