Java Code Examples for java.io.ObjectOutput.writeInt()

The following are Jave code examples for showing how to use writeInt() of the java.io.ObjectOutput class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: xcc   File: THashMap.java   View Source Code Vote up 6 votes
public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(1);

    // NOTE: Super was not written in version 0
    super.writeExternal(out);

    // NUMBER OF ENTRIES
    out.writeInt(_size);

    // ENTRIES
    for (int i = _set.length; i-- > 0;) {
        if (_set[i] != REMOVED && _set[i] != FREE) {
            out.writeObject(_set[i]);
            out.writeObject(_values[i]);
        }
    }
}
 
Example 2
Project: HCFCore   File: TShortHashSet.java   View Source Code Vote up 6 votes
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {

	// VERSION
	out.writeByte( 1 );

	// SUPER
	super.writeExternal( out );

	// NUMBER OF ENTRIES
	out.writeInt( _size );

    // LOAD FACTOR -- Added version 1
    out.writeFloat( _loadFactor );

    // NO ENTRY VALUE -- Added version 1
    out.writeShort( no_entry_value );

	// ENTRIES
    for ( int i = _states.length; i-- > 0; ) {
        if ( _states[i] == FULL ) {
            out.writeShort( _set[i] );
        }
    }
}
 
Example 3
Project: HCFCore   File: TShortHashSet.java   View Source Code Vote up 6 votes
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {

	// VERSION
	out.writeByte( 1 );

	// SUPER
	super.writeExternal( out );

	// NUMBER OF ENTRIES
	out.writeInt( _size );

    // LOAD FACTOR -- Added version 1
    out.writeFloat( _loadFactor );

    // NO ENTRY VALUE -- Added version 1
    out.writeShort( no_entry_value );

	// ENTRIES
    for ( int i = _states.length; i-- > 0; ) {
        if ( _states[i] == FULL ) {
            out.writeShort( _set[i] );
        }
    }
}
 
Example 4
Project: tomcat7   File: RpcMessage.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeBoolean(reply);
    out.writeInt(uuid.length);
    out.write(uuid, 0, uuid.length);
    out.writeInt(rpcId.length);
    out.write(rpcId, 0, rpcId.length);
    out.writeObject(message);
}
 
Example 5
Project: HCFCore   File: TIntCharHash.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
    // VERSION
	out.writeByte( 0 );

    // SUPER
	super.writeExternal( out );

	// NO_ENTRY_KEY
	out.writeInt( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeChar( no_entry_value );
}
 
Example 6
Project: hashsdn-controller   File: ConnectClientSuccessProxyV1.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
    super.writeExternal(out);

    out.writeObject(Serialization.serializedActorPath(backend));
    out.writeInt(maxMessages);

    out.writeInt(alternates.size());
    for (ActorSelection b : alternates) {
        out.writeObject(b.toSerializationFormat());
    }
}
 
Example 7
Project: HCFCore   File: TLongLinkedList.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(0);

    // NO_ENTRY_VALUE
    out.writeLong(no_entry_value);

    // ENTRIES
    out.writeInt(size);
    for (TLongIterator iterator = iterator(); iterator.hasNext();) {
        long next = iterator.next();
        out.writeLong(next);
    }
}
 
Example 8
Project: openjdk-jdk10   File: HijrahDate.java   View Source Code Vote up 5 votes
void writeExternal(ObjectOutput out) throws IOException {
    // HijrahChronology is implicit in the Hijrah_DATE_TYPE
    out.writeObject(getChronology());
    out.writeInt(get(YEAR));
    out.writeByte(get(MONTH_OF_YEAR));
    out.writeByte(get(DAY_OF_MONTH));
}
 
Example 9
Project: HCFCore   File: TIntCharHash.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
    // VERSION
	out.writeByte( 0 );

    // SUPER
	super.writeExternal( out );

	// NO_ENTRY_KEY
	out.writeInt( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeChar( no_entry_value );
}
 
Example 10
Project: xcc   File: TByteLinkedList.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(0);

    // NO_ENTRY_VALUE
    out.writeByte(no_entry_value);

    // ENTRIES
    out.writeInt(size);
    for (TByteIterator iterator = iterator(); iterator.hasNext();) {
        byte next = iterator.next();
        out.writeByte(next);
    }
}
 
Example 11
Project: xcc   File: TFloatIntHash.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
    // VERSION
	out.writeByte( 0 );

    // SUPER
	super.writeExternal( out );

	// NO_ENTRY_KEY
	out.writeFloat( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeInt( no_entry_value );
}
 
Example 12
Project: Higher-Cloud-Computing-Project   File: DenseLocalOffHeapVectorStorage.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
    out.writeInt(size);
    out.writeInt(ptrInitHash);

    for (int i = 0; i < size; i++)
        out.writeDouble(get(i));
}
 
Example 13
Project: lazycat   File: RpcMessage.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeInt(uuid.length);
	out.write(uuid, 0, uuid.length);
	out.writeInt(rpcId.length);
	out.write(rpcId, 0, rpcId.length);
}
 
Example 14
Project: hashsdn-controller   File: DatastoreSnapshot.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeObject(datastoreSnapshot.type);
    out.writeObject(datastoreSnapshot.shardManagerSnapshot);

    out.writeInt(datastoreSnapshot.shardSnapshots.size());
    for (ShardSnapshot shardSnapshot: datastoreSnapshot.shardSnapshots) {
        out.writeObject(shardSnapshot);
    }
}
 
Example 15
Project: Higher-Cloud-Computing-Project   File: MatrixDelegateStorage.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
    out.writeObject(dlg);

    out.writeInt(rowOff);
    out.writeInt(colOff);

    out.writeInt(rows);
    out.writeInt(cols);
}
 
Example 16
Project: unitimes   File: XRequest.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeLong(iRequestId);
	out.writeInt(iPriority);
	out.writeBoolean(iAlternative);
	out.writeLong(iStudentId);
}
 
Example 17
Project: xcc   File: TFloatLinkedList.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(0);

    // NO_ENTRY_VALUE
    out.writeFloat(no_entry_value);

    // ENTRIES
    out.writeInt(size);
    for (TFloatIterator iterator = iterator(); iterator.hasNext();) {
        float next = iterator.next();
        out.writeFloat(next);
    }
}
 
Example 18
Project: unitimes   File: XExpectations.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeLong(iOfferingId);
	out.writeInt(iExpectations == null ? 0 : iExpectations.size());
	if (iExpectations != null) {
		for (Map.Entry<Long, Double> entry: iExpectations.entrySet()) {
			out.writeLong(entry.getKey());
			out.writeDouble(entry.getValue());
		}
	}
}
 
Example 19
Project: xcc   File: TIntIntHash.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
public void writeExternal( ObjectOutput out ) throws IOException {
    // VERSION
	out.writeByte( 0 );

    // SUPER
	super.writeExternal( out );

	// NO_ENTRY_KEY
	out.writeInt( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeInt( no_entry_value );
}
 
Example 20
Project: apache-tomcat-7.0.73-with-comment   File: MemberImpl.java   View Source Code Vote up 4 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    byte[] data = this.getData();
    out.writeInt(data.length);
    out.write(data);
}