當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectOutput.writeBoolean方法代碼示例

本文整理匯總了Java中java.io.ObjectOutput.writeBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectOutput.writeBoolean方法的具體用法?Java ObjectOutput.writeBoolean怎麽用?Java ObjectOutput.writeBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.io.ObjectOutput的用法示例。


在下文中一共展示了ObjectOutput.writeBoolean方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
/**
 * Write this list out to the given stream as part of serialization
 * 
 * @param oos The stream to which to serialize our state
 */
@Override
public void writeExternal(ObjectOutput oos) throws IOException {
	oos.writeBoolean( sorted );

	oos.writeInt( executables.size() );
	for ( E e : executables ) {
		oos.writeObject( e );
	}

	// if the spaces are initialized, write them out for usage after deserialization
	if ( querySpaces == null ) {
		oos.writeInt( -1 );
	}
	else {
		oos.writeInt( querySpaces.size() );
		// these are always String, why we treat them as Serializable instead is beyond me...
		for ( Serializable querySpace : querySpaces ) {
			oos.writeUTF( querySpace.toString() );
		}
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:27,代碼來源:ExecutableList.java

示例2: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeLong(iUniqueId);
	out.writeObject(iInstructionalType);
	out.writeObject(iName);
	
	out.writeInt(iSections.size());
	for (XSection section: iSections)
		section.writeExternal(out);
	
	out.writeLong(iConfigId);
	out.writeLong(iParentId == null ? -1l : iParentId);
	
	out.writeBoolean(iCredit != null);
	if (iCredit != null)
		iCredit.writeExternal(out);
	
	out.writeBoolean(iAllowOverlap);
	
	out.writeInt(iCreditByCourse.size());
	for (Map.Entry<Long, XCredit> entry: iCreditByCourse.entrySet()) {
		out.writeLong(entry.getKey());
		entry.getValue().writeExternal(out);
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:26,代碼來源:XSubpart.java

示例3: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@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);
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:10,代碼來源:RpcMessage.java

示例4: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
    out.writeObject(this.id);
    out.writeObject(this.attributes);
    out.writeBoolean(this.isRemembered);
    out.writeObject(this.roles);
    out.writeObject(this.permissions);
}
 
開發者ID:yaochi,項目名稱:pac4j-plus,代碼行數:9,代碼來源:UserProfile.java

示例5: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
/**
 * This is the place where we serialize attributes, and all theirs
 * elements.
 * 
 * {@inheritDoc}
 */
@Override
public void writeExternal( ObjectOutput out ) throws IOException
{
    // Write the UPId
    out.writeUTF( upId );
    
    // Write the ID
    out.writeUTF( id );

    // Write the HR flag, if not null
    if ( isHR != null )
    {
        out.writeBoolean( true );
        out.writeBoolean( isHR );
    }
    else
    {
        out.writeBoolean( false );
    }

    // Write the number of values
    out.writeInt( size() );

    if ( size() > 0 )
    {
        // Write each value
        for ( Value value : values )
        {
            // Write the value
            value.writeExternal( out );
        }
    }

    out.flush();
}
 
開發者ID:apache,項目名稱:directory-ldap-api,代碼行數:42,代碼來源:DefaultAttribute.java

示例6: marshalValue

import java.io.ObjectOutput; //導入方法依賴的package包/類
/**
 * Marshal value to an ObjectOutput sink using RMI's serialization
 * format for parameters or return values.
 */
protected static void marshalValue(Class<?> type, Object value,
                                   ObjectOutput out)
    throws IOException
{
    if (type.isPrimitive()) {
        if (type == int.class) {
            out.writeInt(((Integer) value).intValue());
        } else if (type == boolean.class) {
            out.writeBoolean(((Boolean) value).booleanValue());
        } else if (type == byte.class) {
            out.writeByte(((Byte) value).byteValue());
        } else if (type == char.class) {
            out.writeChar(((Character) value).charValue());
        } else if (type == short.class) {
            out.writeShort(((Short) value).shortValue());
        } else if (type == long.class) {
            out.writeLong(((Long) value).longValue());
        } else if (type == float.class) {
            out.writeFloat(((Float) value).floatValue());
        } else if (type == double.class) {
            out.writeDouble(((Double) value).doubleValue());
        } else {
            throw new Error("Unrecognized primitive type: " + type);
        }
    } else {
        out.writeObject(value);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:33,代碼來源:UnicastRef.java

示例7: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
    out.writeObject(sto);
    out.writeObject(meta);
    out.writeObject(guid);
    out.writeBoolean(readOnly);
}
 
開發者ID:Luodian,項目名稱:Higher-Cloud-Computing-Project,代碼行數:8,代碼來源:AbstractVector.java

示例8: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(this.getId());
    out.writeLong(this.getTopicId());
    out.writeLong(this.getGenerationTime());
    out.writeLong(this.getFinishedTime());
    out.writeBoolean(this.isConsolidated());
    out.writeBoolean(this.isReady());
    out.writeObject(this.getChoosenTime());
}
 
開發者ID:Naoghuman,項目名稱:ABC-List,代碼行數:11,代碼來源:Exercise.java

示例9: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@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);
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:10,代碼來源:RpcMessage.java

示例10: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeLong(iUniqueId);
	out.writeObject(iName);
	out.writeLong(iOfferingId);
	out.writeInt(iLimit);
	
	out.writeInt(iSubparts.size());
	for (XSubpart subpart: iSubparts)
		subpart.writeExternal(out);
	
	out.writeBoolean(iInstructionalMethod != null);
	if (iInstructionalMethod != null)
		iInstructionalMethod.writeExternal(out);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:16,代碼來源:XConfig.java

示例11: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeShort(appendEntriesReply.raftVersion);
    out.writeLong(appendEntriesReply.getTerm());
    out.writeObject(appendEntriesReply.followerId);
    out.writeBoolean(appendEntriesReply.success);
    out.writeLong(appendEntriesReply.logLastIndex);
    out.writeLong(appendEntriesReply.logLastTerm);
    out.writeShort(appendEntriesReply.payloadVersion);
    out.writeBoolean(appendEntriesReply.forceInstallSnapshot);
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:12,代碼來源:AppendEntriesReply.java

示例12: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeLong(iUniqueId);
	out.writeObject(iExternalId);
	out.writeObject(iName);
	out.writeObject(iEmail);
	out.writeBoolean(iAllowOverlap);
	out.writeBoolean(iDisplay);
	out.writeBoolean(iInstructing);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:11,代碼來源:XInstructor.java

示例13: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(this.getId());
    out.writeLong(this.getExerciseId());
    out.writeLong(this.getTermId());
    out.writeBoolean(this.isMarkAsWrong());
}
 
開發者ID:Naoghuman,項目名稱:ABC-List,代碼行數:8,代碼來源:ExerciseTerm.java

示例14: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    super.writeExternal(out);

    // Save environent if support is non-null.
    // XXX #13685: When support is null, the tc will be discarded 
    // after deserialization.
    out.writeObject((support != null) ? support.cesEnv() : null);

    // #16461 Caret could be null?!,
    // hot fix - making it robust for that case.
    int pos = 0;

    // 19559 Even pane could be null! Better solution would be put
    // writeReplace method in place also, but it is a API change. For
    // the time be just robust here.
    JEditorPane p = pane;

    if (p != null) {
        Caret caret = p.getCaret();

        if (caret != null) {
            pos = caret.getDot();
        } else {
            if (p instanceof QuietEditorPane) {
                int lastPos = ((QuietEditorPane) p).getLastPosition();

                if (lastPos == -1) {
                    Logger.getLogger(CloneableEditor.class.getName()).log(Level.WARNING, null,
                                      new java.lang.IllegalStateException("Pane=" +
                                                                          p +
                                                                          "was not initialized yet!"));
                } else {
                    pos = lastPos;
                }
            } else {
                Document doc = ((support != null) ? support.getDocument() : null);

                // Relevant only if document is non-null?!
                if (doc != null) {
                    Logger.getLogger(CloneableEditor.class.getName()).log(Level.WARNING, null,
                                      new java.lang.IllegalStateException("Caret is null in editor pane=" +
                                                                          p +
                                                                          "\nsupport=" +
                                                                          support +
                                                                          "\ndoc=" +
                                                                          doc));
                }
            }
        }
    }

    out.writeObject(new Integer(pos));
    out.writeBoolean(getLookup() == support.getLookup());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:56,代碼來源:CloneableEditor.java

示例15: writeExternal

import java.io.ObjectOutput; //導入方法依賴的package包/類
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
    super.writeExternal(out);
    out.writeBoolean(snapshotOnly);
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:6,代碼來源:AbstractReadTransactionRequestProxyV1.java


注:本文中的java.io.ObjectOutput.writeBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。