当前位置: 首页>>代码示例>>Java>>正文


Java DataOutputStream.writeBoolean方法代码示例

本文整理汇总了Java中java.io.DataOutputStream.writeBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java DataOutputStream.writeBoolean方法的具体用法?Java DataOutputStream.writeBoolean怎么用?Java DataOutputStream.writeBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.DataOutputStream的用法示例。


在下文中一共展示了DataOutputStream.writeBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeToStream

import java.io.DataOutputStream; //导入方法依赖的package包/类
public void writeToStream(DataOutputStream out) throws IOException {
    out.writeInt(threadId);
    out.writeUTF(threadName);

    out.writeBoolean(collectingTwoTimeStamps);

    out.writeInt(compactData.length);
    out.write(compactData);
    out.writeInt(nodeSize);

    out.writeLong(wholeGraphGrossTimeAbs);
    out.writeLong(wholeGraphGrossTimeThreadCPU);
    out.writeDouble(timeInInjectedCodeInAbsCounts);
    out.writeDouble(timeInInjectedCodeInThreadCPUCounts);
    out.writeLong(wholeGraphPureTimeAbs);
    out.writeLong(wholeGraphPureTimeThreadCPU);
    out.writeLong(wholeGraphNetTime0);
    out.writeLong(wholeGraphNetTime1);
    out.writeLong(totalInvNo);
    out.writeBoolean(displayWholeThreadCPUTime);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:CPUCCTContainer.java

示例2: initializeData

import java.io.DataOutputStream; //导入方法依赖的package包/类
private void initializeData(DataOutputStream out) throws IOException {
  /* Write out various test values NORMALLY */
  out.write(new byte[] { -100, 100 });
  out.writeBoolean(true);
  out.writeBoolean(false);
  out.writeByte(100);
  out.writeByte(-100);
  out.writeByte((byte) 200);
  out.writeChar('a');
  out.writeShort((short) -30000);
  out.writeShort((short) 50000);
  out.writeInt(0xCAFEBABE);
  out.writeLong(0xDEADBEEFCAFEBABEL);
  out.writeUTF("Herby Derby");
  out.writeFloat(Float.intBitsToFloat(0xCAFEBABE));
  out.writeDouble(Double.longBitsToDouble(0xDEADBEEFCAFEBABEL));
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:18,代码来源:LittleEndianDataInputStreamTest.java

示例3: write

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
public void write(DataOutputStream output) throws IOException {
    super.write(output);
    
    output.writeBoolean(getValue().isScaling());
    output.writeBoolean(getValue().hasLocationName());
    if(getValue().hasLocationName()) {
        output.writeUTF(getValue().getLocationName());
    }
    output.writeBoolean(getValue().hasColor());
    if(getValue().hasColor()) {
        output.writeInt(getValue().getColor().getRed());
        output.writeInt(getValue().getColor().getGreen());
        output.writeInt(getValue().getColor().getBlue());
    }
}
 
开发者ID:OrigamiDream,项目名称:Leveled-Storage,代码行数:17,代码来源:MapMetaStorage.java

示例4: writeHeaderAndWrapStream

import java.io.DataOutputStream; //导入方法依赖的package包/类
/**
 * Write out a header to the given stream that indicates the chosen
 * compression codec, and return the same stream wrapped with that codec.
 * If no codec is specified, simply adds buffering to the stream, so that
 * the returned stream is always buffered.
 * 
 * @param os The stream to write header to and wrap. This stream should
 * be unbuffered.
 * @return A stream wrapped with the specified compressor, or buffering
 * if compression is not enabled.
 * @throws IOException if an IO error occurs or the compressor cannot be
 * instantiated
 */
DataOutputStream writeHeaderAndWrapStream(OutputStream os)
throws IOException {
  DataOutputStream dos = new DataOutputStream(os);

  dos.writeBoolean(imageCodec != null);

  if (imageCodec != null) {
    String codecClassName = imageCodec.getClass().getCanonicalName();
    Text.writeString(dos, codecClassName);

    return new DataOutputStream(imageCodec.createOutputStream(os));
  } else {
    // use a buffered output stream
    return new DataOutputStream(new BufferedOutputStream(os));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:30,代码来源:FSImageCompression.java

示例5: save

import java.io.DataOutputStream; //导入方法依赖的package包/类
/**
 * Save the set to a file
 * 
 * @param file The file to save to
 * 
 * @throws IOException Indicates a failure to write to disk
 */
public void save(File file) throws IOException {
	DataOutputStream dout = new DataOutputStream(new FileOutputStream(file));
	dout.writeUTF(name);
	for (int i=0;i<256;i++) {
		dout.writeBoolean(chars[i]);
	}
	dout.close();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:16,代码来源:CharSet.java

示例6: writeToStream

import java.io.DataOutputStream; //导入方法依赖的package包/类
public void writeToStream(DataOutputStream out) throws IOException {
    super.writeToStream(out);

    out.writeInt(nProfiledClasses);

    for (int i = 0; i < nProfiledClasses; i++) {
        out.writeUTF(classNames[i]);
        out.writeLong(objectsSizePerClass[i]);
    }

    out.writeBoolean(stacksForClasses != null);

    if (stacksForClasses != null) {
        out.writeInt(stacksForClasses.length);

        //.err.println("Stored len: " +stacksForClasses.length);
        for (int i = 0; i < stacksForClasses.length; i++) {
            if (stacksForClasses[i] == null) {
                //System.err.println("  [" + i + "] = 0");
                out.writeInt(0);
            } else {
                out.writeInt(stacksForClasses[i].getType());
                //System.err.println("  [" + i + "] = " + stacksForClasses[i].getType());
                stacksForClasses[i].writeToStream(out);
            }
        }

        out.writeBoolean(table != null);

        if (table != null) {
            table.writeToStream(out);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:MemoryResultsSnapshot.java

示例7: write

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
public void write(DataOutputStream output) throws IOException {
    super.write(output);
    
    output.writeBoolean(getValue().hasEffect());
    if(getValue().hasEffect()) {
        FireworkEffectStorage storage = new FireworkEffectStorage(getValue().getEffect());
        storage.write(output);
    }
}
 
开发者ID:OrigamiDream,项目名称:Leveled-Storage,代码行数:11,代码来源:FireworkEffectMetaStorage.java

示例8: onWritePacket

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
protected void onWritePacket(DataOutputStream out) throws IOException {
	out.writeUTF(username);
	
	out.writeFloat(targetX);
	out.writeFloat(targetY);
	
	out.writeBoolean(isPrimaryPointer);
}
 
开发者ID:ProjectK47,项目名称:Mafia,代码行数:10,代码来源:PacketSpawnPointer.java

示例9: write

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
public void write(DataOutputStream output) throws IOException {
    super.write(output);
    
    output.writeBoolean(getValue().hasEffects());
    if(getValue().hasEffects()) {
        ArrayListStorage<FireworkEffectStorage> storage = new ArrayListStorage<FireworkEffectStorage>(getValue().getEffects().stream().map(FireworkEffectStorage::new).collect(Collectors.toList()));
        storage.write(output);
    }
}
 
开发者ID:OrigamiDream,项目名称:Leveled-Storage,代码行数:11,代码来源:FireworkMetaStorage.java

示例10: write

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
public void write(DataOutputStream output) throws IOException {
    output.writeBoolean(getValue().hasDisplayName());
    if(getValue().hasDisplayName()) {
        output.writeUTF(getValue().getDisplayName());
    }
    
    output.writeBoolean(getValue().hasLocalizedName());
    if(getValue().hasLocalizedName()) {
        output.writeUTF(getValue().getLocalizedName());
    }
    
    ArrayListStorage<StringStorage> loreStorage = new ArrayListStorage<StringStorage>(getValue().hasLore() ? getValue().getLore().stream().map(StringStorage::new).collect(Collectors.toList()) : new ArrayList<>());
    loreStorage.write(output);
    
    output.writeInt(getValue().getEnchants().size());
    
    Map<EnchantmentStorage, IntStorage> storages = new HashMap<>();
    getValue().getEnchants().forEach((enchantment, level) -> storages.put(new EnchantmentStorage(enchantment), new IntStorage(level)));
    HashMapStorage<EnchantmentStorage, IntStorage> enchantStorage = new HashMapStorage<EnchantmentStorage, IntStorage>(storages);
    enchantStorage.write(output);
    
    output.writeInt(getValue().getItemFlags().size());
    for(ItemFlag flag : getValue().getItemFlags()) {
        output.writeUTF(flag.toString());
    }
    
    output.writeBoolean(getValue().isUnbreakable());
}
 
开发者ID:OrigamiDream,项目名称:Leveled-Storage,代码行数:30,代码来源:ItemMetaStorage.java

示例11: createInvalidSessionPacket

import java.io.DataOutputStream; //导入方法依赖的package包/类
/**
 * Forge an invalid session packet as a LEADER do
 * 
 * @throws Exception
 */
private QuorumPacket createInvalidSessionPacket() throws Exception {
    QuorumPacket qp = createValidateSessionQuorumPacket();
    ByteArrayInputStream bis = new ByteArrayInputStream(qp.getData());
    DataInputStream dis = new DataInputStream(bis);
    long id = dis.readLong();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(bos);
    dos.writeLong(id);
    // false means that the session has expired
    dos.writeBoolean(false);
    qp.setData(bos.toByteArray());
    return qp;
}
 
开发者ID:l294265421,项目名称:ZooKeeper,代码行数:19,代码来源:WatchLeakTest.java

示例12: write

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
public void write(DataOutputStream output) throws IOException {
    super.write(output);
    
    output.writeBoolean(getValue().hasOwner());
    if(getValue().hasOwner()) {
        output.writeUTF(getValue().getOwner());
    }
}
 
开发者ID:OrigamiDream,项目名称:Leveled-Storage,代码行数:10,代码来源:SkullMetaStorage.java

示例13: saveToStream

import java.io.DataOutputStream; //导入方法依赖的package包/类
private void saveToStream(DataOutputStream out) throws IOException {
    // URL is no longer included. Keep for backward compatability.
    out.writeUTF("");
    out.writeUTF(mName);
    out.writeUTF(mValue);
    out.writeUTF(mDomain);
    out.writeUTF(mPath);
    out.writeLong(mCreation);
    out.writeLong(mExpiration);
    out.writeLong(mLastAccess);
    out.writeBoolean(mSecure);
    out.writeBoolean(mHttpOnly);
    out.writeInt(mSameSite);
    out.writeInt(mPriority);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:16,代码来源:CanonicalCookie.java

示例14: writeStateFile

import java.io.DataOutputStream; //导入方法依赖的package包/类
/**
 * Write out the new state file:  the version number, followed by the
 * three bits of data as we sent them off to the backup transport.
 */
void writeStateFile(ParcelFileDescriptor stateFile) throws IOException {
    FileOutputStream outstream = new FileOutputStream(stateFile.getFileDescriptor());
    DataOutputStream out = new DataOutputStream(outstream);

    out.writeInt(AGENT_VERSION);
    out.writeInt(mFilling);
    out.writeBoolean(mAddMayo);
    out.writeBoolean(mAddTomato);
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:14,代码来源:ExampleAgent.java

示例15: onWritePacket

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
protected void onWritePacket(DataOutputStream out) throws IOException {
	out.writeUTF(username);
	out.writeBoolean(isMafiaChoice);
}
 
开发者ID:ProjectK47,项目名称:Mafia,代码行数:6,代码来源:PacketEliminationChoice.java


注:本文中的java.io.DataOutputStream.writeBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。