Java 8 OutputStream - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 OutputStream class.

This code example shows how to use the following methods:create_interface_tc, create_output_stream, string_to_object
     
    @Test
    public void testWriteObject() throws IOException {
        URL refUrl = getClass().getResource("/references/account.ref");
        String oRef = IOUtils.toString(refUrl.openStream()).trim();
        org.omg.CORBA.Object objRef = 
            orb.string_to_object(oRef);
        assertNotNull(objRef);
         
        // create a test object 
        org.apache.cxf.binding.corba.wsdl.Object objectType = 
            new org.apache.cxf.binding.corba.wsdl.Object(); 
        objectType.setRepositoryID("IDL:Account:1.0");
        objectType.setBinding(new QName("AccountCORBABinding"));
         
        QName objectName = new QName("TestObject");
        QName objectIdlType = new QName("corbaatm:TestObject");
        TypeCode objectTC = orb.create_interface_tc("IDL:Account:1.0", "TestObject");
         
        CorbaObjectReferenceHandler obj = new CorbaObjectReferenceHandler(objectName, objectIdlType, 

5
CodeRank
This code example shows how to use the following methods:create_interface_tc, create_output_stream, string_to_object
        assertTrue(obj.getValue().equals(new java.math.BigDecimal("12345.67")));
    } 
     
    @Test
    public void testReadObjectReference() throws IOException {
        OutputStream oStream = orb.create_output_stream();
         
        URL refUrl = getClass().getResource("/references/account.ref");
        String oRef = IOUtils.toString(refUrl.openStream()).trim();
        org.omg.CORBA.Object objRef = 
            orb.string_to_object(oRef);
         
        assertNotNull(objRef);
        oStream.write_Object(objRef);
        // we need an ORBinstance to handle reading objects so use the input stream  
        InputStream iStream = oStream.create_input_stream();
         
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
         
        // create a test object 

5
CodeRank
This code example shows how to use the following methods:write_long
    public void read(InputStream inputStream) {
        index = inputStream.read_long();
    } 
 
    public void write(OutputStream outputStream) {
        outputStream.write_long(index);
    } 
 
    @Override 
    public int hashCode() { 
        return getValueAsString().hashCode();
    } 
 
    @Override 
    public boolean equals(Object o) { 
        if (o instanceof EnumValue) { 
            if (getValueAsString().equals(((EnumValue) o).getValueAsString())) {
                return true; 
            } 
        } 
4
CodeRank
This code example shows how to use the following methods:write_string, write_ulong
This code example shows how to use the following methods:write_octet
     * this <code>ByteHolder</code> object. 
     * 
     * @param output the OutputStream which will contain the CDR formatted data. 
     */ 
    public void _write(OutputStream output) {
        output.write_octet(value);
    } 
 
    /** 
     * Returns the TypeCode corresponding to the value held in 
     * this <code>ByteHolder</code> object. 
     * 
     * @return    the TypeCode of the value held in 
     *               this <code>ByteHolder</code> object 
     */ 
    public org.omg.CORBA.TypeCode _type() {
        return ORB.init().get_primitive_tc(TCKind.tk_octet);
    } 
} 
3
CodeRank
This code example shows how to use the following methods:write_double
     * <code>OutputStream</code>. 
     * 
     * @param output the <code>OutputStream</code> to write into. 
     */ 
    public void _write(OutputStream output) {
        output.write_double(value);
    } 
 
    /** 
     * Return the <code>TypeCode</code> of this holder object. 
     * 
     * @return the <code>TypeCode</code> object. 
     */ 
    public org.omg.CORBA.TypeCode _type() {
        return ORB.init().get_primitive_tc(TCKind.tk_double);
    } 
 
 
} 
3
CodeRank
This code example shows how to use the following methods:write_boolean
     * <code>value</code> field to the output stream <code>output</code>. 
     * 
     * @param output the OutputStream which will contain the CDR formatted data 
     */ 
    public void _write(OutputStream output) {
        output.write_boolean(value);
    } 
 
    /** 
     * Retrieves the <code>TypeCode</code> object that corresponds to the 
     * value held in this <code>BooleanHolder</code> object. 
     * 
     * @return    the <code>TypeCode</code> for the value held 
     *            in this <code>BooleanHolder</code> object 
     */ 
    public TypeCode _type() {
        return ORB.init().get_primitive_tc(TCKind.tk_boolean);
    } 
} 
3
CodeRank
This code example shows how to use the following methods:write_longlong
     * Marshals to <code>output</code> the value in the Holder. 
     * 
     * @param output the OutputStream which will contain the CDR formatted data 
     */ 
    public void _write(OutputStream output) {
        output.write_longlong(value);
    } 
 
    /** 
     * Returns the <code>TypeCode</code> object 
     * corresponding to the value held in the Holder. 
     * 
     * @return    the TypeCode of the value held in the holder 
     */ 
    public org.omg.CORBA.TypeCode _type() {
        return ORB.init().get_primitive_tc(TCKind.tk_longlong);
    } 
 
} 
3
CodeRank
This code example shows how to use the following methods:write_long
     * 
     * @param output the <code>OutputStream</code> object that will contain 
     *               the CDR formatted data 
     */ 
    public void _write(OutputStream output) {
        output.write_long(value);
    } 
 
    /** 
     * Retrieves the <code>TypeCode</code> object that corresponds 
     * to the value held in this <code>IntHolder</code> object's 
     * <code>value</code> field. 
     * 
     * @return    the type code for the value held in this <code>IntHolder</code> 
     *            object 
     */ 
    public org.omg.CORBA.TypeCode _type() {
        return ORB.init().get_primitive_tc(TCKind.tk_long);
    } 
} 
4
CodeRank
This code example shows how to use the following methods:write_any
     * this <code>AnyHolder</code> object. 
     * 
     * @param output the OutputStream which will contain the CDR formatted data. 
     */ 
    public void _write(OutputStream output) {
        output.write_any(value);
    } 
 
    /** 
     * Returns the <code>TypeCode</code> object corresponding to the value 
     * held in this <code>AnyHolder</code> object. 
     * 
     * @return    the TypeCode of the value held in 
     *              this <code>AnyHolder</code> object 
     */ 
    public TypeCode _type() {
        return ORB.init().get_primitive_tc(TCKind.tk_any);
    } 
} 
3
CodeRank
See Code Examples for Java 8 OutputStream Methods: