Java Code Examples for org.omg.CORBA.portable.OutputStream#write_fixed()

The following examples show how to use org.omg.CORBA.portable.OutputStream#write_fixed() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CorbaObjectReaderTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Test
public void testReadFixed() {
    if (System.getProperty("java.vendor").contains("IBM")) {
        //The ORB in the IBM jdk doesn't support writing fixed
        //to the stream.
        return;
    }
    OutputStream oStream = orb.create_output_stream();

    // create the following fixed
    // fixed<5,2>
    oStream.write_fixed(new java.math.BigDecimal("12345.67").movePointRight(2));
    InputStream iStream = oStream.create_input_stream();
    CorbaObjectReader reader = new CorbaObjectReader(iStream);

    Fixed fixedType = new Fixed();
    fixedType.setDigits(5);
    fixedType.setScale(2);

    // These values don't matter to the outcome of the test but are needed during construction
    QName fixedName = new QName("TestFixed");
    QName fixedIdlType = new QName("corbatm:TestFixed");
    TypeCode fixedTC = orb.create_fixed_tc((short)fixedType.getDigits(), (short)fixedType.getScale());
    CorbaFixedHandler obj = new CorbaFixedHandler(fixedName, fixedIdlType, fixedTC, fixedType);

    reader.readFixed(obj);

    assertEquals(obj.getValue(), new java.math.BigDecimal("12345.67"));
}
 
Example 2
Source File: FixedHolder.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 3
Source File: FixedHolder.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 4
Source File: FixedHolder.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 5
Source File: FixedHolder.java    From JDKSourceCode1.8 with MIT License 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 6
Source File: FixedHolder.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 7
Source File: FixedHolder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 8
Source File: FixedHolder.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * {@code OutputStream}.
 *
 * @param output the {@code OutputStream} to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 9
Source File: FixedHolder.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 10
Source File: FixedHolder.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 11
Source File: FixedHolder.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}
 
Example 12
Source File: FixedHolder.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Write the fixed point value stored in this holder to an
 * <code>OutputStream</code>.
 *
 * @param output the <code>OutputStream</code> to write into.
 */
public void _write(OutputStream output) {
    output.write_fixed(value);
}