String source = "\ud801\udc49";
byte[] sourceMatch = { (byte) 0xf0, (byte) 0x90, (byte) 0x91, (byte) 0x89 };
assertTrue(length(source) == sourceMatch.length);
assertTrue(length(source) == source.getBytes(getORB().getTCSDefault().getName()).length);
cdrOutputStream.write_string(source);
byte[] bufferCopy = cdrOutputStream.getBufferCopy();
byte[] toMatch = new byte[sourceMatch.length];
System.arraycopy(bufferCopy, 4, toMatch, 0, sourceMatch.length);