ucar.unidata.io.RandomAccessFile.readDouble()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(121)

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

RandomAccessFile.readDouble介绍

[英]Reads a double from this file. This method reads a long value as if by the readLong method and then converts that long to a double using the longBitsToDouble method in class Double.

This method blocks until the eight bytes are read, the end of the stream is detected, or an exception is thrown.
[中]从该文件中读取double。此方法读取long值,就像通过readLong方法一样,然后使用类Double中的longBitsToDouble方法将long转换为double
此方法会一直阻塞,直到读取了八个字节、检测到流结束或引发异常为止。

代码示例

代码示例来源:origin: edu.ucar/netcdf

  1. private ProjectionRect readBoundingBox() throws IOException {
  2. double xMin = raf.readDouble();
  3. double yMin = raf.readDouble();
  4. double xMax = raf.readDouble();
  5. double yMax = raf.readDouble();
  6. return new ProjectionRect(xMin, yMin, xMax, yMax);
  7. }

代码示例来源:origin: edu.ucar/cdm

  1. private ProjectionRect readBoundingBox() throws IOException {
  2. double xMin = raf.readDouble();
  3. double yMin = raf.readDouble();
  4. double xMax = raf.readDouble();
  5. double yMax = raf.readDouble();
  6. return new ProjectionRect(xMin, yMin, xMax, yMax);
  7. }

代码示例来源:origin: Unidata/thredds

  1. private ProjectionRect readBoundingBox() throws IOException {
  2. double xMin = raf.readDouble();
  3. double yMin = raf.readDouble();
  4. double xMax = raf.readDouble();
  5. double yMax = raf.readDouble();
  6. return new ProjectionRect(xMin, yMin, xMax, yMax);
  7. }

代码示例来源:origin: Unidata/thredds

  1. Object readDoubleArray1D(int offsetInRecord) throws IOException {
  2. int elementSizeInBytes = 8;
  3. double[] array = new double[header.getNumDataRecords()];
  4. this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord);
  5. for (int i = 0; i < header.getNumDataRecords(); i++) {
  6. this.raf.readDouble(array, i, 1);
  7. this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes);
  8. }
  9. return (array);
  10. }

代码示例来源:origin: edu.ucar/netcdf

  1. Object readDoubleArray1D(int offsetInRecord) throws IOException {
  2. int elementSizeInBytes = 8;
  3. double[] array = new double[header.getNumDataRecords()];
  4. this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord);
  5. for (int i = 0; i < header.getNumDataRecords(); i++) {
  6. this.raf.readDouble(array, i, 1);
  7. this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes);
  8. }
  9. return (array);
  10. }

代码示例来源:origin: edu.ucar/cdm

  1. Object readDoubleArray1D(int offsetInRecord) throws IOException {
  2. int elementSizeInBytes = 8;
  3. double[] array = new double[header.getNumDataRecords()];
  4. this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord);
  5. for (int i = 0; i < header.getNumDataRecords(); i++) {
  6. this.raf.readDouble(array, i, 1);
  7. this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes);
  8. }
  9. return (array);
  10. }

代码示例来源:origin: edu.ucar/netcdf

  1. double d = raf.readDouble();

代码示例来源:origin: edu.ucar/cdm

  1. double d = raf.readDouble();

代码示例来源:origin: Unidata/thredds

  1. double d = raf.readDouble();

代码示例来源:origin: Unidata/thredds

  1. case 6:
  2. if (nelems == 1)
  3. att = new Attribute(name, raf.readDouble());
  4. else {
  5. double[] vals = new double[nelems];
  6. for (int i = 0; i < nelems; i++)
  7. vals[i] = raf.readDouble();
  8. att = new Attribute(name, Array.factory(DataType.DOUBLE, new int[]{nelems}, vals));

代码示例来源:origin: Unidata/thredds

  1. double[] pa = new double[heapId.nelems];
  2. raf.seek(ho.dataPos);
  3. raf.readDouble(pa, 0, pa.length);
  4. return Array.factory(dataType, new int[]{pa.length}, pa);

代码示例来源:origin: edu.ucar/cdm

  1. double[] pa = new double[heapId.nelems];
  2. raf.seek(ho.dataPos);
  3. raf.readDouble(pa, 0, pa.length);
  4. return Array.factory(dataType.getPrimitiveClassType(), new int[]{pa.length}, pa);

代码示例来源:origin: edu.ucar/cdm

  1. case 6:
  2. if (nelems == 1)
  3. att = new Attribute(name, raf.readDouble());
  4. else {
  5. double[] vals = new double[nelems];
  6. for (int i = 0; i < nelems; i++)
  7. vals[i] = raf.readDouble();
  8. att = new Attribute(name, Array.factory(DataType.DOUBLE.getPrimitiveClassType(), new int[]{nelems}, vals));

代码示例来源:origin: edu.ucar/netcdf

  1. double[] pa = new double[heapId.nelems];
  2. raf.seek(ho.dataPos);
  3. raf.readDouble(pa, 0, pa.length);
  4. return Array.factory(dataType.getPrimitiveClassType(), new int[]{pa.length}, pa);

代码示例来源:origin: edu.ucar/netcdf

  1. case 6:
  2. if (nelems == 1)
  3. att = new Attribute(name, raf.readDouble());
  4. else {
  5. double[] vals = new double[nelems];
  6. for (int i = 0; i < nelems; i++)
  7. vals[i] = raf.readDouble();
  8. att = new Attribute(name, Array.factory(DataType.DOUBLE.getPrimitiveClassType(), new int[]{nelems}, vals));

代码示例来源:origin: edu.ucar/netcdf

  1. raf.order(byteOrder);
  2. raf.seek(chunk.getSrcPos());
  3. raf.readDouble(pa, (int) chunk.getDestElem(), chunk.getNelems());

代码示例来源:origin: edu.ucar/cdm

  1. raf.order(byteOrder);
  2. raf.seek(chunk.getSrcPos());
  3. raf.readDouble(pa, (int) chunk.getDestElem(), chunk.getNelems());

代码示例来源:origin: Unidata/thredds

  1. raf.order(byteOrder);
  2. raf.seek(chunk.getSrcPos());
  3. raf.readDouble(pa, (int) chunk.getDestElem(), chunk.getNelems());

相关文章