本文整理汇总了Java中java.io.ObjectOutputStream.writeDouble方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectOutputStream.writeDouble方法的具体用法?Java ObjectOutputStream.writeDouble怎么用?Java ObjectOutputStream.writeDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectOutputStream
的用法示例。
在下文中一共展示了ObjectOutputStream.writeDouble方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
void writeObject(ObjectOutputStream out) throws IOException {
out.writeInt(nTotalInstrMethods);
out.writeInt(nClassLoads);
out.writeInt(nFirstMethodInvocations);
out.writeInt(nNonEmptyInstrMethodGroupResponses);
out.writeInt(nEmptyInstrMethodGroupResponses);
out.writeInt(nSingleMethodInstrMethodGroupResponses);
out.writeDouble(clientInstrTime);
out.writeDouble(clientDataProcTime);
out.writeDouble(totalHotswappingTime);
out.writeDouble(averageHotswappingTime);
out.writeDouble(minHotswappingTime);
out.writeDouble(maxHotswappingTime);
out.writeDouble(methodEntryExitCallTime0);
out.writeDouble(methodEntryExitCallTime1);
out.writeDouble(methodEntryExitCallTime2);
}
示例2: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
void writeObject(ObjectOutputStream out) throws IOException {
int len = methodEntryExitCallTime.length;
out.writeInt(len);
for (int i = 0; i < len; i++) {
out.writeDouble(methodEntryExitCallTime[i]);
}
for (int i = 0; i < len; i++) {
out.writeDouble(methodEntryExitInnerTime[i]);
}
for (int i = 0; i < len; i++) {
out.writeDouble(methodEntryExitOuterTime[i]);
}
out.writeLong(timerCountsInSecond[0]);
out.writeLong(timerCountsInSecond[1]);
}
示例3: writeNode
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
protected void writeNode(ObjectOutputStream out, IConstBspNode<ArrayList<Triangle>, AxisAlignedPlane3D> node, HashMap<Triangle, Integer> triangleToIndexMap ) throws IOException {
out.writeBoolean( node.isInternal() );
if ( node.isInternal() ) {
IConstBspInternalNode<ArrayList<Triangle>, AxisAlignedPlane3D> internalNode = node.asInternal();
out.writeInt( internalNode.getBoundary().axis.ordinal() );
out.writeDouble( internalNode.getBoundary().origin );
writeNode( out, internalNode.getNegativeChild(), triangleToIndexMap );
writeNode( out, internalNode.getPositiveChild(), triangleToIndexMap );
} else {
ArrayList<Triangle> triangles = node.asLeaf().getData();
out.writeInt( triangles.size() );
for ( Triangle triangle : triangles ) {
out.writeInt( triangleToIndexMap.get(triangle) );
}
}
}
示例4: doReps
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Run benchmark for given number of batches, with given number of cycles
* for each batch.
*/
void doReps(ObjectOutputStream oout, ObjectInputStream oin,
StreamBuffer sbuf, int nbatches, int ncycles)
throws Exception
{
for (int i = 0; i < nbatches; i++) {
sbuf.reset();
for (int j = 0; j < ncycles; j++) {
oout.writeDouble(0.0);
}
oout.flush();
for (int j = 0; j < ncycles; j++) {
oin.readDouble();
}
}
}
示例5: writeSupportVectors
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/** Writes the example set into the given output stream. */
public void writeSupportVectors(ObjectOutputStream out) throws IOException {
out.writeInt(getNumberOfSupportVectors());
out.writeDouble(b);
out.writeInt(dim);
if ((meanVarianceMap == null) || (meanVarianceMap.size() == 0)) {
out.writeUTF("noscale");
} else {
out.writeUTF("scale");
out.writeInt(meanVarianceMap.size());
Iterator i = meanVarianceMap.keySet().iterator();
while (i.hasNext()) {
Integer index = (Integer) i.next();
MeanVariance meanVariance = meanVarianceMap.get(index);
out.writeInt(index.intValue());
out.writeDouble(meanVariance.getMean());
out.writeDouble(meanVariance.getVariance());
}
}
for (int e = 0; e < train_size; e++) {
if (alphas[e] != 0.0d) {
out.writeInt(atts[e].length);
for (int a = 0; a < atts[e].length; a++) {
out.writeInt(index[e][a]);
out.writeDouble(atts[e][a]);
}
out.writeDouble(alphas[e]);
out.writeDouble(ys[e]);
}
}
}
示例6: save
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
static void save( List<PrecomputedRaycastResult> data, String fileName ) {
try {
ObjectOutputStream raycastDataFile = new ObjectOutputStream( new FileOutputStream("DM-Flux2_raycastDump.bin") );
for (PrecomputedRaycastResult result : data ) {
raycastDataFile.writeObject(result.request.from);
raycastDataFile.writeObject(result.request.to);
raycastDataFile.writeDouble(result.hitDistance);
}
raycastDataFile.close();
} catch (IOException e) {
fail("Failed to save data.");
}
}
示例7: saveStats
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Saves the statistics logged so far
*/
protected static void saveStats(){
JFileChooser chooser = new JFileChooser();
chooser.setFileFilter(new FileNameExtensionFilter("Keys per second statistics file", "kpsstats"));
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
if(chooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION){
return;
}
File file = new File(chooser.getSelectedFile().getAbsolutePath().endsWith(".kpsstats") ? chooser.getSelectedFile().getAbsolutePath() : (chooser.getSelectedFile().getAbsolutePath() + ".kpsstats"));
if(!file.exists() || (file.exists() && JOptionPane.showConfirmDialog(null, "File already exists, overwrite?", "Keys per second", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)){
try {
file.createNewFile();
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file));
out.writeInt(TotPanel.hits);
out.writeDouble(avg);
out.writeInt(max);
out.writeLong(n);
out.writeInt(prev);
out.writeInt(tmp.get());
for(Entry<Integer, Key> key : keys.entrySet()){
out.writeInt(key.getKey());
out.writeObject(key.getValue());
}
out.flush();
out.close();
JOptionPane.showMessageDialog(null, "Statistics succesfully saved", "Keys per second", JOptionPane.INFORMATION_MESSAGE);
} catch (IOException e) {e.printStackTrace();
JOptionPane.showMessageDialog(null, "Failed to save the statistics!", "Keys per second", JOptionPane.ERROR_MESSAGE);
}
}
}
示例8: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeLong(mCoordinates != null ? mCoordinates.first : -1);
out.writeLong(mCoordinates != null ? mCoordinates.second : -1);
out.writeUTF(mLocation != null ? mLocation.getProvider() : null);
out.writeDouble(mLocation != null ? mLocation.getLatitude() : -1);
out.writeDouble(mLocation != null ? mLocation.getLongitude() : -1);
out.writeFloat(mLocation != null ? mLocation.getAccuracy() : -1);
out.writeDouble(mLocation != null ? mLocation.getAltitude() : -1);
}
示例9: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream out) throws IOException {
out.writeBoolean(z);
out.writeByte(b);
out.writeChar(c);
out.writeShort(s);
out.writeInt(i);
out.writeFloat(f);
out.writeLong(j);
out.writeDouble(d);
out.writeObject(str);
out.writeObject(parent);
out.writeObject(left);
out.writeObject(right);
}
示例10: write
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
for (int index : indexes) {
final double value = getDouble(index);
os.writeDouble(value);
}
}
示例11: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/** Custom serialization */
private void writeObject(ObjectOutputStream os) throws IOException {
os.writeInt(length);
os.writeDouble(defaultValue);
for (int i=0; i<length; ++i) {
final double value = getDouble(i);
os.writeDouble(value);
}
}
示例12: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/** Custom serialization */
private void writeObject(ObjectOutputStream os) throws IOException {
os.writeInt(values.length);
for (double value : values) {
os.writeDouble(value);
}
}
示例13: writeParameters
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
void writeParameters(ObjectOutputStream out) throws IOException {
out.writeDouble(this.a);
out.writeDouble(this.b);
}
示例14: write
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
@Override
public final void write(ObjectOutputStream os, int[] indexes) throws IOException {
for (int index : indexes) {
os.writeDouble(values[index]);
}
}