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

The following are Jave code examples for showing how to use writeLong() 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: hashsdn-controller   File: InstallSnapshot.java   View Source Code Vote up 6 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(installSnapshot.getTerm());
    out.writeObject(installSnapshot.leaderId);
    out.writeLong(installSnapshot.lastIncludedIndex);
    out.writeLong(installSnapshot.lastIncludedTerm);
    out.writeInt(installSnapshot.chunkIndex);
    out.writeInt(installSnapshot.totalChunks);

    out.writeByte(installSnapshot.lastChunkHashCode.isPresent() ? 1 : 0);
    if (installSnapshot.lastChunkHashCode.isPresent()) {
        out.writeInt(installSnapshot.lastChunkHashCode.get().intValue());
    }

    out.writeByte(installSnapshot.serverConfig.isPresent() ? 1 : 0);
    if (installSnapshot.serverConfig.isPresent()) {
        out.writeObject(installSnapshot.serverConfig.get());
    }

    out.writeObject(installSnapshot.data);
}
 
Example 2
Project: unitimes   File: XEnrollment.java   View Source Code Vote up 6 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	super.writeExternal(out);
	
	out.writeLong(iStudentId);
	out.writeLong(iConfigId);
	
	out.writeInt(iSectionIds.size());
	for (Long sectionId: iSectionIds)
		out.writeLong(sectionId);
	
	out.writeBoolean(iTimeStamp != null);
	if (iTimeStamp != null)
		out.writeLong(iTimeStamp.getTime());
	
	out.writeBoolean(iApproval != null);
	if (iApproval != null)
		iApproval.writeExternal(out);
	
	out.writeBoolean(iReservation != null);
	if (iReservation != null)
		iReservation.writeExternal(out);
}
 
Example 3
Project: hashsdn-controller   File: Snapshot.java   View Source Code Vote up 6 votes
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
    out.writeLong(snapshot.lastIndex);
    out.writeLong(snapshot.lastTerm);
    out.writeLong(snapshot.lastAppliedIndex);
    out.writeLong(snapshot.lastAppliedTerm);
    out.writeLong(snapshot.electionTerm);
    out.writeObject(snapshot.electionVotedFor);
    out.writeObject(snapshot.serverConfig);

    out.writeInt(snapshot.unAppliedEntries.size());
    for (ReplicatedLogEntry e: snapshot.unAppliedEntries) {
        out.writeLong(e.getIndex());
        out.writeLong(e.getTerm());
        out.writeObject(e.getData());
    }

    out.writeObject(snapshot.state);
}
 
Example 4
Project: ABC-List   File: Link.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(this.getId());
    out.writeLong(this.getGenerationTime());
    out.writeObject(this.getAlias()); // TODO (de-/encrypt for db)
    out.writeObject(this.getDescription()); // TODO (de-/encrypt for db)
    out.writeObject(this.getUrl()); // TODO (de-/encrypt for db)
    out.writeObject(this.getImage());
    out.writeBoolean(this.getFavorite());
}
 
Example 5
Project: HCFCore   File: TLongDoubleHash.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.writeLong( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeDouble( no_entry_value );
}
 
Example 6
Project: HCFCore   File: TLongCharHash.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.writeLong( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeChar( no_entry_value );
}
 
Example 7
Project: xcc   File: TLongFloatHash.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.writeLong( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeFloat( no_entry_value );
}
 
Example 8
Project: xcc   File: TDoubleLongHash.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.writeDouble( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeLong( no_entry_value );
}
 
Example 9
Project: xcc   File: TByteLongHash.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.writeByte( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeLong( no_entry_value );
}
 
Example 10
Project: Higher-Cloud-Computing-Project   File: MatrixBlockKey.java   View Source Code Vote up 5 votes
/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
    out.writeObject(matrixUuid);
    out.writeObject(affinityKey);
    out.writeLong(blockIdRow);
    out.writeLong(blockIdCol);
}
 
Example 11
Project: HCFCore   File: TLongDoubleHash.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.writeLong( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeDouble( no_entry_value );
}
 
Example 12
Project: HCFCore   File: TByteLongHash.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.writeByte( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeLong( no_entry_value );
}
 
Example 13
Project: xcc   File: TLongLongHash.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.writeLong( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeLong( no_entry_value );
}
 
Example 14
Project: unitimes   File: XDistribution.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeLong(iDistributionId);
	out.writeInt(iVariant);
	out.writeInt(iType.ordinal());
	
	out.writeInt(iOfferingIds.size());
	for (Long offeringId: iOfferingIds)
		out.writeLong(offeringId);
	
	out.writeInt(iSectionIds.size());
	for (Long sectionId: iSectionIds)
		out.writeLong(sectionId);
}
 
Example 15
Project: hashsdn-controller   File: RequestVote.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(requestVote.getTerm());
    out.writeObject(requestVote.candidateId);
    out.writeLong(requestVote.lastLogIndex);
    out.writeLong(requestVote.lastLogTerm);
}
 
Example 16
Project: xcc   File: TShortLongHash.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.writeShort( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeLong( no_entry_value );
}
 
Example 17
Project: myfaces-trinidad   File: FacesMessageWrapper.java   View Source Code Vote up 5 votes
/**
 * Writes this object to the serialized stream.
 * 
 * @param objectOutput
 * @throws IOException
 */
public void writeExternal(ObjectOutput objectOutput)
  throws IOException
{
  objectOutput.writeLong(serialVersionUID);
  objectOutput.writeObject(_wrapped);
  objectOutput.writeObject(_label);
}
 
Example 18
Project: HCFCore   File: TDoubleLongHash.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.writeDouble( no_entry_key );

	// NO_ENTRY_VALUE
	out.writeLong( no_entry_value );
}
 
Example 19
Project: unitimes   File: XStudent.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	super.writeExternal(out);
	
	out.writeInt(iMajors.size());
	for (XAreaClassificationMajor major: iMajors)
		major.writeExternal(out);
	
	out.writeInt(iGroups.size());
	for (String group: iGroups)
		out.writeObject(group);
	
	out.writeInt(iAccomodations.size());
	for (String accomodation: iAccomodations)
		out.writeObject(accomodation);
	
	out.writeInt(iRequests.size());
	for (XRequest request: iRequests)
		if (request instanceof XCourseRequest) {
			out.writeBoolean(true);
			((XCourseRequest)request).writeExternal(out);
		} else {
			out.writeBoolean(false);
			((XFreeTimeRequest)request).writeExternal(out);
		}
	
	out.writeObject(iStatus);
	out.writeObject(iEmail);
	
	out.writeBoolean(iEmailTimeStamp != null);
	if (iEmailTimeStamp != null)
		out.writeLong(iEmailTimeStamp.getTime());
	
	out.writeBoolean(iLastNote != null);
	if (iLastNote != null)
		iLastNote.writeExternal(out);
}
 
Example 20
Project: unitimes   File: XEnrollments.java   View Source Code Vote up 5 votes
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeLong(iOfferingId);
	out.writeInt(iRequests.size());
	for (XCourseRequest request: iRequests)
		request.writeExternal(out);
}