本文整理汇总了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);
}
示例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));
}
示例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());
}
}
示例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));
}
}
示例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();
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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());
}
示例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;
}
示例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());
}
}
示例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);
}
示例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);
}
示例15: onWritePacket
import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
protected void onWritePacket(DataOutputStream out) throws IOException {
out.writeUTF(username);
out.writeBoolean(isMafiaChoice);
}