本文整理了Java中java.io.ObjectInputStream.readDouble()
方法的一些代码示例,展示了ObjectInputStream.readDouble()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectInputStream.readDouble()
方法的具体详情如下:
包路径:java.io.ObjectInputStream
类名称:ObjectInputStream
方法名:readDouble
[英]Reads a double (64 bit) from the source stream.
[中]从源流中读取双精度(64位)。
代码示例来源:origin: google/guava
/** Reconstitutes the instance from a stream (that is, deserializes it). */
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
set(s.readDouble());
}
}
代码示例来源:origin: hankcs/HanLP
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
size = in.readInt();
data = (int[]) in.readObject();
linearExpandFactor = in.readInt();
exponentialExpanding = in.readBoolean();
exponentialExpandFactor = in.readDouble();
}
代码示例来源:origin: prestodb/presto
/** Reconstitutes the instance from a stream (that is, deserializes it). */
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
// Read in array length and allocate array
int length = s.readInt();
this.longs = new AtomicLongArray(length);
// Read in all elements in the proper order.
for (int i = 0; i < length; i++) {
set(i, s.readDouble());
}
}
}
代码示例来源:origin: google/guava
/** Reconstitutes the instance from a stream (that is, deserializes it). */
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
int length = s.readInt();
ImmutableLongArray.Builder builder = ImmutableLongArray.builder();
for (int i = 0; i < length; i++) {
builder.add(doubleToRawLongBits(s.readDouble()));
}
this.longs = new AtomicLongArray(builder.build().toArray());
}
}
代码示例来源:origin: prestodb/presto
/** Reconstitutes the instance from a stream (that is, deserializes it). */
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
set(s.readDouble());
}
}
代码示例来源:origin: HdrHistogram/HdrHistogram
private void readObject(final ObjectInputStream o)
throws IOException, ClassNotFoundException {
final long lowestDiscernibleValue = o.readLong();
final long highestTrackableValue = o.readLong();
final int numberOfSignificantValueDigits = o.readInt();
final int normalizingIndexOffset = o.readInt();
final double integerToDoubleValueConversionRatio = o.readDouble();
final long indicatedTotalCount = o.readLong();
final long indicatedMaxValue = o.readLong();
final long indicatedMinNonZeroValue = o.readLong();
final long indicatedStartTimeStampMsec = o.readLong();
final long indicatedEndTimeStampMsec = o.readLong();
final boolean indicatedAutoResize = o.readBoolean();
final int indicatedwordSizeInBytes = o.readInt();
init(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantValueDigits,
integerToDoubleValueConversionRatio, normalizingIndexOffset);
// Set internalTrackingValues (can't establish them from array yet, because it's not yet read...)
setTotalCount(indicatedTotalCount);
maxValue = indicatedMaxValue;
minNonZeroValue = indicatedMinNonZeroValue;
startTimeStampMsec = indicatedStartTimeStampMsec;
endTimeStampMsec = indicatedEndTimeStampMsec;
autoResize = indicatedAutoResize;
wordSizeInBytes = indicatedwordSizeInBytes;
}
代码示例来源:origin: google/j2objc
/** Reconstitutes the instance from a stream (that is, deserializes it). */
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
int length = s.readInt();
ImmutableLongArray.Builder builder = ImmutableLongArray.builder();
for (int i = 0; i < length; i++) {
builder.add(doubleToRawLongBits(s.readDouble()));
}
this.longs = new AtomicLongArray(builder.build().toArray());
}
}
代码示例来源:origin: google/j2objc
/** Reconstitutes the instance from a stream (that is, deserializes it). */
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
value = new AtomicLong();
set(s.readDouble());
}
}
代码示例来源:origin: org.apache.commons/commons-math3
final int n = ois.readInt();
final double[] data = new double[n];
for (int i = 0; i < n; ++i) {
data[i] = ois.readDouble();
代码示例来源:origin: wildfly/wildfly
/** Reconstitutes the instance from a stream (that is, deserializes it). */
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
int length = s.readInt();
ImmutableLongArray.Builder builder = ImmutableLongArray.builder();
for (int i = 0; i < length; i++) {
builder.add(doubleToRawLongBits(s.readDouble()));
}
this.longs = new AtomicLongArray(builder.build().toArray());
}
}
代码示例来源:origin: stanfordnlp/CoreNLP
/**
* Reconstitutes the instance from a stream (that is, deserializes it).
* @param s the stream
* @throws ClassNotFoundException if the class of a serialized object
* could not be found
* @throws java.io.IOException if an I/O error occurs
*/
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
set(s.readDouble());
}
代码示例来源:origin: org.apache.commons/commons-math3
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();
代码示例来源:origin: cc.mallet/mallet
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException
{
in.defaultReadObject ();
in.readInt (); // serial version
var = (Variable) in.readObject ();
alpha = in.readDouble ();
beta = in.readDouble ();
min = in.readDouble ();
max = in.readDouble ();
}
代码示例来源:origin: wildfly/wildfly
/** Reconstitutes the instance from a stream (that is, deserializes it). */
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
set(s.readDouble());
}
}
代码示例来源:origin: lenskit/lenskit
private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException {
featureCount = input.readInt();
userCount = input.readInt();
itemCount = input.readInt();
RealMatrix umat = MatrixUtils.createRealMatrix(userCount, featureCount);
for (int i = 0; i < userCount; i++) {
for (int j = 0; j < featureCount; j++) {
umat.setEntry(i, j, input.readDouble());
}
}
userMatrix = umat;
RealMatrix imat = MatrixUtils.createRealMatrix(itemCount, featureCount);
for (int i = 0; i < itemCount; i++) {
for (int j = 0; j < featureCount; j++) {
imat.setEntry(i, j, input.readDouble());
}
}
itemMatrix = imat;
userIndex = (KeyIndex) input.readObject();
itemIndex = (KeyIndex) input.readObject();
if (userIndex.size() != userMatrix.getRowDimension()) {
throw new InvalidObjectException("user matrix and index have different row counts");
}
if (itemIndex.size() != itemMatrix.getRowDimension()) {
throw new InvalidObjectException("item matrix and index have different row counts");
}
}
代码示例来源:origin: de.julielab/jcore-mallet-2.0.9
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException
{
in.defaultReadObject ();
in.readInt (); // serial version
var = (Variable) in.readObject ();
alpha = in.readDouble ();
beta = in.readDouble ();
min = in.readDouble ();
max = in.readDouble ();
}
代码示例来源:origin: stackoverflow.com
public class MyDummyClass implements java.io.Serialiazable {
// mark it transient so defaultReadObject()/defaultWriteObject() ignore it
private transient com.google.android.gms.maps.model.LatLng mLocation;
// ...
private void writeObject(ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeDouble(mLocation.latitude);
out.writeDouble(mLocation.longitude);
}
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
mLocation = new LatLng(in.readDouble(), in.readDouble());
}
}
代码示例来源:origin: com.github.steveash.mallet/mallet
private void readObject(ObjectInputStream in) throws IOException {
in.readInt(); // version
l1Weight = in.readDouble();
}
}
代码示例来源:origin: com.github.steveash.mallet/mallet
private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException
{
in.defaultReadObject ();
in.readInt (); // serial version
var = (Variable) in.readObject ();
alpha = in.readDouble ();
beta = in.readDouble ();
min = in.readDouble ();
max = in.readDouble ();
}
代码示例来源:origin: geotools/geotools
/**
* Read this object from the specified stream. This method is necessary because the super-class
* is not serializable.
*/
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
x = in.readDouble();
y = in.readDouble();
z = in.readDouble();
}
}
内容来源于网络,如有侵权,请联系作者删除!