当前位置: 首页>>代码示例>>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;未经允许,请勿转载。