本文整理汇总了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() );
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例15: writeExternal
import java.io.ObjectOutput; //导入方法依赖的package包/类
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
super.writeExternal(out);
out.writeBoolean(snapshotOnly);
}