Package org.jacorb.orb

Examples of org.jacorb.orb.CodeSet$InputBuffer


        CodeSetComponentInfo info = pior.getCodeSetComponentInfo();
        if (info != null && !ignoreComponentInfo)
        {
            connection.markTCSNegotiated(); // even if this aborts, we should not try negotiating again.
            CodeSet c1 = CodeSet.getNegotiatedCodeSet((org.jacorb.orb.ORB)orb, info, /* wide */ false );
            CodeSet c2 = CodeSet.getNegotiatedCodeSet((org.jacorb.orb.ORB)orb, info, /* wide */ true );

            connection.setCodeSets( c1, c2);

            logger.info ("Negotiated char codeset of " + c1 +
                         " and wchar of " + c2);
View Full Code Here


*/
public class CodesetWriteStringTest {

  @Test
  public void testStringWith1Byte() {
    CodeSet codeSet = CodeSet.getCodeSet("utf8");

    CDROutputStream cdrOutputStream = new CDROutputStream();
    byte[] expected = new byte[] {(byte)0x61};
    String string = "a";

    codeSet.write_string(cdrOutputStream, string, false, false, 2);
    byte[] bufferCopy = cdrOutputStream.getBufferCopy();
    Assert.assertArrayEquals(expected, bufferCopy);
  }
View Full Code Here

    Assert.assertArrayEquals(expected, bufferCopy);
  }

  @Test
  public void testStringWith2Byte() {
    CodeSet codeSet = CodeSet.getCodeSet("utf8");

    CDROutputStream cdrOutputStream = new CDROutputStream();
    byte[] expected = new byte[] {(byte)0xc2, (byte)0xae};
    String string = "ยฎ";

    codeSet.write_string(cdrOutputStream, string, false, false, 2);
    byte[] bufferCopy = cdrOutputStream.getBufferCopy();
    Assert.assertArrayEquals(expected, bufferCopy);
  }
View Full Code Here

    Assert.assertArrayEquals(expected, bufferCopy);
  }

  @Test
  public void testStringWith3Byte() {
    CodeSet codeSet = CodeSet.getCodeSet("utf8");

    CDROutputStream cdrOutputStream = new CDROutputStream();
    byte[] expected = new byte[] {(byte)0xe0, (byte)0xa4, (byte)0xbf};
    String string = "เคฟ";

    codeSet.write_string(cdrOutputStream, string, false, false, 2);
    byte[] bufferCopy = cdrOutputStream.getBufferCopy();
    Assert.assertArrayEquals(expected, bufferCopy);
  }
View Full Code Here

    Assert.assertArrayEquals(expected, bufferCopy);
  }

  @Test
  public void testStringWith4Byte() {
    CodeSet codeSet = CodeSet.getCodeSet("utf8");

    CDROutputStream cdrOutputStream = new CDROutputStream();
    byte[] expected = new byte[] {(byte)0xf0, (byte)0x9f, (byte)0x98, (byte)0x8e};
    String string = "๐Ÿ˜Ž";

    codeSet.write_string(cdrOutputStream, string, false, false, 2);
    byte[] bufferCopy = cdrOutputStream.getBufferCopy();
    Assert.assertArrayEquals(expected, bufferCopy);
  }
View Full Code Here

    Assert.assertArrayEquals(expected, bufferCopy);
  }

  @Test
  public void testMixedString() {
    CodeSet codeSet = CodeSet.getCodeSet("utf8");

    CDROutputStream cdrOutputStream = new CDROutputStream();
    byte[] expected = new byte[] {
        (byte)0x61,                      // a
        (byte)0x73,                      // s
        (byte)0x64,                      // d
        (byte)0x66,                      // f
        (byte)0x20,                      // space
        (byte)0xe0, (byte)0xa4, (byte)0x91,          // DEVANAGARI LETTER CANDRA O
        (byte)0x20,                      // space
        (byte)0xe1, (byte)0x85, (byte)0x93,          // HANGUL CHOSEONG CHIEUCH-HIEUH
        (byte)0x20,                      // space
        (byte)0xf0, (byte)0x90, (byte)0x90, (byte)0xa7,   // DESERET CAPITAL LETTER EW
        (byte)0x20,                      // space
        (byte)0xf0, (byte)0x90, (byte)0x91, (byte)0x89,    // DESERET SMALL LETTER ER
        (byte)0x20,                      // space
        (byte)0xf0, (byte)0x9d, (byte)0x96, (byte)0x84,    // MATHEMATICAL BOLD FRAKTUR CAPITAL Y
        (byte)0x20,                      // space
        (byte)0xf0, (byte)0x9f, (byte)0x88, (byte)0xb3,    // SQUARED CJK UNIFIED IDEOGRAPH-7A7A
        (byte)0x20,                      // space
        (byte)0xcd, (byte)0xb2,                // GREEK CAPITAL LETTER ARCHAIC SAMPI
        (byte)0xd1, (byte)0xbe                // CYRILLIC CAPITAL LETTER OT
        };
    String string = "asdf เค‘ แ…“ ๐ง ๐‘‰ ๐–„ ๐Ÿˆณ อฒัพ";

    codeSet.write_string(cdrOutputStream, string, false, false, 2);
    byte[] bufferCopy = cdrOutputStream.getBufferCopy();
    Assert.assertArrayEquals(expected, bufferCopy);
  }
View Full Code Here

TOP

Related Classes of org.jacorb.orb.CodeSet$InputBuffer

Copyright © 2018 www.massapicom. 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.