java.io.ObjectInputStream.readLong()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(194)

本文整理了Java中java.io.ObjectInputStream.readLong()方法的一些代码示例,展示了ObjectInputStream.readLong()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectInputStream.readLong()方法的具体详情如下:
包路径:java.io.ObjectInputStream
类名称:ObjectInputStream
方法名:readLong

ObjectInputStream.readLong介绍

[英]Reads a long (64 bit) from the source stream.
[中]从源流中读取长(64位)。

代码示例

代码示例来源:origin: google/guava

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
  s.defaultReadObject();
  busy = 0;
  cells = null;
  base = s.readLong();
 }
}

代码示例来源: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: h2oai/h2o-2

private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException  {
 s.defaultReadObject();      // Read nothing
 initialize(MIN_SIZE);
 for (;;) {
  final long K = s.readLong();
  final TypeV V = (TypeV) s.readObject();
  if( K == NO_KEY && V == null ) break;
  put(K,V);               // Insert with an offical put
 }
}

代码示例来源:origin: aa112901/remusic

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    String name = (String) in.readObject();
    String value = (String) in.readObject();
    clientCookie = new HttpCookie(name, value);
    clientCookie.setComment((String) in.readObject());
    clientCookie.setCommentURL((String) in.readObject());
    clientCookie.setDomain((String) in.readObject());
    clientCookie.setMaxAge(in.readLong());
    clientCookie.setPath((String) in.readObject());
    clientCookie.setPortlist((String) in.readObject());
    clientCookie.setVersion(in.readInt());
    clientCookie.setSecure(in.readBoolean());
    clientCookie.setDiscard(in.readBoolean());
  }
}

代码示例来源:origin: io.snappydata/gemfire-trove

private void readObject(ObjectInputStream stream)
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    int size = stream.readInt();
    setUp(size);
    while (size-- > 0) {
      long key = stream.readLong();
      Object val = stream.readObject();
      put(key, val);
    }
  }
} // TLongObjectHashMap

代码示例来源:origin: jenkinsci/jenkins

private ConsoleAnnotator<T> createAnnotator(StaplerRequest req) throws IOException {
  try {
    String base64 = req!=null ? req.getHeader("X-ConsoleAnnotator") : null;
    if (base64!=null) {
      Cipher sym = PASSING_ANNOTATOR.decrypt();
      ObjectInputStream ois = new ObjectInputStreamEx(new GZIPInputStream(
          new CipherInputStream(new ByteArrayInputStream(Base64.decode(base64.toCharArray())),sym)),
          Jenkins.getInstance().pluginManager.uberClassLoader);
      try {
        long timestamp = ois.readLong();
        if (TimeUnit.HOURS.toMillis(1) > abs(System.currentTimeMillis()-timestamp))
          // don't deserialize something too old to prevent a replay attack
          return (ConsoleAnnotator)ois.readObject();
      } finally {
        ois.close();
      }
    }
  } catch (ClassNotFoundException e) {
    throw new IOException(e);
  }
  // start from scratch
  return ConsoleAnnotator.initial(context);
}

代码示例来源:origin: it.unimi.dsi/fastutil

private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
    s.defaultReadObject();
    key = new int[size];
    value = new long[size];
    for (int i = 0; i < size; i++) {
      key[i] = s.readInt();
      value[i] = s.readLong();
    }
  }
}

代码示例来源:origin: JCTools/JCTools

private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException  {
 s.defaultReadObject();      // Read nothing
 initialize(MIN_SIZE);
 for (;;) {
  final long K = s.readLong();
  final TypeV V = (TypeV) s.readObject();
  if( K == NO_KEY && V == null ) break;
  put(K,V);               // Insert with an offical put
 }
}

代码示例来源:origin: frohoff/ysoserial

ois.readInt(); // method
ois.readLong(); // hash
System.err.println("Is DGC call for " + Arrays.toString((ObjID[])ois.readObject()));

代码示例来源:origin: de.julielab/jcore-mallet-0.4

private void readObject(ObjectInputStream stream)
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();

    int size = stream.readInt();
    setUp(size);
    while (size-- > 0) {
      long key = stream.readLong();
      Object val = stream.readObject();
      put(key, val);
    }
  }
} // TLongObjectHashMap

代码示例来源:origin: HdrHistogram/HdrHistogram

private void readObject(final ObjectInputStream o)
    throws IOException, ClassNotFoundException {
  final long configuredHighestToLowestValueRatio = o.readLong();
  final double lowestValueInAutoRange = o.readDouble();
  AbstractHistogram integerValuesHistogram = (AbstractHistogram) o.readObject();
  init(configuredHighestToLowestValueRatio, lowestValueInAutoRange, integerValuesHistogram);
}

代码示例来源:origin: it.unimi.dsi/fastutil

private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
    s.defaultReadObject();
    array = new long[s.readInt()];
    for (int i = 0; i < size; i++)
      array[i] = s.readLong();
  }
}

代码示例来源:origin: google/guava

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
  s.defaultReadObject();
  busy = 0;
  cells = null;
  base = s.readLong();
 }
}

代码示例来源:origin: oracle/opengrok

private void readObject(ObjectInputStream in) throws ClassNotFoundException,
    IOException {
  boolean hasValue = in.readBoolean();
  String vstring = in.readUTF();
  projectName = hasValue ? vstring : null;
  hasValue = in.readBoolean();
  int vint = in.readInt();
  tabSize = hasValue ? vint : null;
  hasValue = in.readBoolean();
  long vlong = in.readLong();
  analyzerGuruVersion = hasValue ? vlong : null;
  /**
   * De-serialization circumvents normal construction, so the following
   * field could be null.
   */
  if (analyzersVersions == null) {
    analyzersVersions = new HashMap<>();
  }
  int analyzerCount = in.readInt();
  for (int i = 0; i < analyzerCount; ++i) {
    vstring = in.readUTF();
    vlong = in.readLong();
    analyzersVersions.put(vstring, vlong);
  }
}

代码示例来源:origin: fengjiachun/Jupiter

@SuppressWarnings("unchecked")
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
  s.defaultReadObject();      // Read nothing
  initialize(MIN_SIZE);
  for (;;) {
    final long K = s.readLong();
    final TypeV V = (TypeV) s.readObject();
    if (K == NO_KEY && V == null) break;
    put(K, V);               // Insert with an offical put
  }
}

代码示例来源:origin: stackoverflow.com

String name = (String) in.readObject();
String value = (String) in.readObject();
clientCookie = new HttpCookie(name, value);
clientCookie.setComment((String) in.readObject());
clientCookie.setCommentURL((String) in.readObject());
clientCookie.setDomain((String) in.readObject());
clientCookie.setMaxAge(in.readLong());
clientCookie.setPath((String) in.readObject());
clientCookie.setPortlist((String) in.readObject());
clientCookie.setVersion(in.readInt());
clientCookie.setSecure(in.readBoolean());
clientCookie.setDiscard(in.readBoolean());

代码示例来源:origin: io.snappydata/gemfire-trove

private void readObject(ObjectInputStream stream)
  throws IOException, ClassNotFoundException {
  stream.defaultReadObject();
  int size = stream.readInt();
  setUp(size);
  while (size-- > 0) {
    Object key = stream.readObject();
    long val = stream.readLong();
    put(key, val);
  }
}

代码示例来源:origin: ethereum/ethereumj

try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file))) {
  logger.info("Loading dataset from " + file.getAbsolutePath());
  long bNum = ois.readLong();
  if (bNum == blockNumber) {
    fullData = (int[]) ois.readObject();
    logger.info("Dataset loaded.");
    fireDatatasetStatusUpdate(FULL_DATASET_LOADED);

代码示例来源:origin: it.unimi.dsi/fastutil

private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
    s.defaultReadObject();
    heap = new long[s.readInt()];
    for (int i = 0; i < size; i++)
      heap[i] = s.readLong();
  }
}

代码示例来源:origin: prestodb/presto

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
  s.defaultReadObject();
  busy = 0;
  cells = null;
  base = s.readLong();
 }
}

相关文章

ObjectInputStream类方法