當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。