java.io.ObjectInputStream#readDouble ( )源码实例Demo

下面列出了java.io.ObjectInputStream#readDouble ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: dragonwell8_jdk   文件: Doubles.java
/**
 * 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();
        }
    }
}
 
源代码2 项目: dragonwell8_jdk   文件: CustomObjTrees.java
private void readObject(ObjectInputStream in)
    throws IOException, ClassNotFoundException
{
    z = in.readBoolean();
    b = in.readByte();
    c = in.readChar();
    s = in.readShort();
    i = in.readInt();
    f = in.readFloat();
    j = in.readLong();
    d = in.readDouble();
    str = (String) in.readObject();
    parent = in.readObject();
    left = in.readObject();
    right = in.readObject();
}
 
源代码3 项目: ccu-historian   文件: SerialUtilities.java
/**
 * Reads a <code>Point2D</code> object that has been serialised by the
 * {@link #writePoint2D(Point2D, ObjectOutputStream)} method.
 *
 * @param stream  the input stream (<code>null</code> not permitted).
 *
 * @return The point object (possibly <code>null</code>).
 *
 * @throws IOException  if there is an I/O problem.
 */
public static Point2D readPoint2D(final ObjectInputStream stream)
    throws IOException {

    if (stream == null) {
        throw new IllegalArgumentException("Null 'stream' argument.");
    }
    Point2D result = null;
    final boolean isNull = stream.readBoolean();
    if (!isNull) {
        final double x = stream.readDouble();
        final double y = stream.readDouble();
        result = new Point2D.Double(x, y);
    }
    return result;

}
 
源代码4 项目: openjdk-8-source   文件: Doubles.java
/**
 * 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 项目: openjdk-jdk8u   文件: Doubles.java
/**
 * 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();
        }
    }
}
 
源代码6 项目: visualvm   文件: InternalStatsResponse.java
void readObject(ObjectInputStream in) throws IOException {
    nTotalInstrMethods = in.readInt();
    nClassLoads = in.readInt();
    nFirstMethodInvocations = in.readInt();
    nNonEmptyInstrMethodGroupResponses = in.readInt();
    nEmptyInstrMethodGroupResponses = in.readInt();
    nSingleMethodInstrMethodGroupResponses = in.readInt();
    clientInstrTime = in.readDouble();
    clientDataProcTime = in.readDouble();
    totalHotswappingTime = in.readDouble();
    averageHotswappingTime = in.readDouble();
    minHotswappingTime = in.readDouble();
    maxHotswappingTime = in.readDouble();
    methodEntryExitCallTime0 = in.readDouble();
    methodEntryExitCallTime1 = in.readDouble();
    methodEntryExitCallTime2 = in.readDouble();
}
 
源代码7 项目: openjdk-jdk8u-backup   文件: Doubles.java
/**
 * 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();
        }
    }
}
 
源代码8 项目: jdk8u_jdk   文件: Doubles.java
/**
 * 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();
        }
    }
}
 
源代码9 项目: openjdk-8-source   文件: CustomObjTrees.java
private void readObject(ObjectInputStream in)
    throws IOException, ClassNotFoundException
{
    z = in.readBoolean();
    b = in.readByte();
    c = in.readChar();
    s = in.readShort();
    i = in.readInt();
    f = in.readFloat();
    j = in.readLong();
    d = in.readDouble();
    str = (String) in.readObject();
    parent = in.readObject();
    left = in.readObject();
    right = in.readObject();
}
 
源代码10 项目: jdk8u-jdk   文件: Doubles.java
/**
 * 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();
        }
    }
}
 
源代码11 项目: gemfirexd-oss   文件: TDoubleDoubleHashMap.java
private void readObject(ObjectInputStream stream)
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    int size = stream.readInt();
    setUp(size);
    while (size-- > 0) {
        double key = stream.readDouble();
        double val = stream.readDouble();
        put(key, val);
    }
}
 
源代码12 项目: gemfirexd-oss   文件: TDoubleIntHashMap.java
private void readObject(ObjectInputStream stream)
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    int size = stream.readInt();
    setUp(size);
    while (size-- > 0) {
        double key = stream.readDouble();
        int val = stream.readInt();
        put(key, val);
    }
}
 
源代码13 项目: hipparchus   文件: MatrixUtils.java
/** Deserialize  a {@link RealMatrix} field in a class.
 * <p>
 * This method is intended to be called from within a private
 * <code>readObject</code> method (after a call to
 * <code>ois.defaultReadObject()</code>) in a class that has a
 * {@link RealMatrix} field, which should be declared <code>transient</code>.
 * This way, the default handling does not deserialize the matrix (the {@link
 * RealMatrix} interface is not serializable by default) but this method does
 * deserialize it specifically.
 * </p>
 * @param instance instance in which the field must be set up
 * @param fieldName name of the field within the class (may be private and final)
 * @param ois stream from which the real matrix should be read
 * @exception ClassNotFoundException if a class in the stream cannot be found
 * @exception IOException if object cannot be read from the stream
 * @see #serializeRealMatrix(RealMatrix, ObjectOutputStream)
 */
public static void deserializeRealMatrix(final Object instance,
                                         final String fieldName,
                                         final ObjectInputStream ois)
  throws ClassNotFoundException, IOException {
    try {

        // read the matrix data
        final int n = ois.readInt();
        final int m = ois.readInt();
        final double[][] data = new double[n][m];
        for (int i = 0; i < n; ++i) {
            final double[] dataI = data[i];
            for (int j = 0; j < m; ++j) {
                dataI[j] = ois.readDouble();
            }
        }

        // create the instance
        final RealMatrix matrix = new Array2DRowRealMatrix(data, false);

        // set up the field
        final java.lang.reflect.Field f =
            instance.getClass().getDeclaredField(fieldName);
        f.setAccessible(true);
        f.set(instance, matrix);

    } catch (NoSuchFieldException | IllegalAccessException e) {
        IOException ioe = new IOException();
        ioe.initCause(e);
        throw ioe;
    }
}
 
源代码14 项目: gemfirexd-oss   文件: TDoubleFloatHashMap.java
private void readObject(ObjectInputStream stream)
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    int size = stream.readInt();
    setUp(size);
    while (size-- > 0) {
        double key = stream.readDouble();
        float val = stream.readFloat();
        put(key, val);
    }
}
 
源代码15 项目: pentaho-reporting   文件: Ellipse2DSerializer.java
/**
 * Reads the object from the object input stream.
 *
 * @param in the object input stream from where to read the serialized data.
 * @return the generated object.
 * @throws IOException            if reading the stream failed.
 * @throws ClassNotFoundException if serialized object class cannot be found.
 */
public Object readObject( final ObjectInputStream in )
  throws IOException, ClassNotFoundException {
  final double x = in.readDouble();
  final double y = in.readDouble();
  final double w = in.readDouble();
  final double h = in.readDouble();
  return new Ellipse2D.Double( x, y, w, h );
}
 
源代码16 项目: pentaho-reporting   文件: Line2DSerializer.java
/**
 * Reads the object from the object input stream.
 *
 * @param in the object input stream from where to read the serialized data.
 * @return the generated object.
 * @throws IOException            if reading the stream failed.
 * @throws ClassNotFoundException if serialized object class cannot be found.
 */
public Object readObject( final ObjectInputStream in )
  throws IOException, ClassNotFoundException {
  final double x1 = in.readDouble();
  final double y1 = in.readDouble();
  final double x2 = in.readDouble();
  final double y2 = in.readDouble();
  return new Line2D.Double( x1, y1, x2, y2 );
}
 
源代码17 项目: morpheus-core   文件: SparseArrayOfDoubles.java
@Override
public final void read(ObjectInputStream is, int count) throws IOException {
    for (int i=0; i<count; ++i) {
        final double value = is.readDouble();
        this.setDouble(i, value);
    }
}
 
源代码18 项目: gemfirexd-oss   文件: TDoubleLongHashMap.java
private void readObject(ObjectInputStream stream)
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    int size = stream.readInt();
    setUp(size);
    while (size-- > 0) {
        double key = stream.readDouble();
        long val = stream.readLong();
        put(key, val);
    }
}
 
源代码19 项目: gemfirexd-oss   文件: TDoubleIntHashMap.java
private void readObject(ObjectInputStream stream)
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    int size = stream.readInt();
    setUp(size);
    while (size-- > 0) {
        double key = stream.readDouble();
        int val = stream.readInt();
        put(key, val);
    }
}
 
源代码20 项目: gemfirexd-oss   文件: TDoubleObjectHashMap.java
private void readObject(ObjectInputStream stream)
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    int size = stream.readInt();
    setUp(size);
    while (size-- > 0) {
        double key = stream.readDouble();
        Object val = stream.readObject();
        put(key, val);
    }
}