本文整理了Java中ucar.unidata.io.RandomAccessFile.readFloat
方法的一些代码示例,展示了RandomAccessFile.readFloat
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RandomAccessFile.readFloat
方法的具体详情如下:
包路径:ucar.unidata.io.RandomAccessFile
类名称:RandomAccessFile
方法名:readFloat
[英]Reads a float
from this file. This method reads an int
value as if by the readInt
method and then converts that int
to a float
using the intBitsToFloat
method in class Float
.
This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.
[中]从该文件中读取float
。此方法读取int
值,就像通过readInt
方法一样,然后使用类Float
中的intBitsToFloat
方法将int
转换为float
。
此方法会一直阻塞,直到读取了四个字节、检测到流结束或引发异常为止。
代码示例来源:origin: edu.ucar/cdm
private float getDataBlockValue1(RandomAccessFile raf, short offset, int skip) throws IOException {
long off = offset + message_offset + MESSAGE_HEADER_SIZE;
raf.seek(off);
raf.skipBytes(skip);
return raf.readFloat();
}
代码示例来源:origin: edu.ucar/netcdf
private float getDataBlockValue1(RandomAccessFile raf, short offset, int skip) throws IOException {
long off = offset + message_offset + MESSAGE_HEADER_SIZE;
raf.seek(off);
raf.skipBytes(skip);
return raf.readFloat();
}
代码示例来源:origin: Unidata/thredds
private float getDataBlockValue1(RandomAccessFile raf, short offset, int skip) throws IOException {
long off = offset + message_offset + MESSAGE_HEADER_SIZE;
raf.seek(off);
raf.skipBytes(skip);
return raf.readFloat();
}
代码示例来源:origin: Unidata/thredds
Type0(RandomAccessFile raf) throws IOException {
this.referenceValue = raf.readFloat();
this.binaryScaleFactor = GribNumbers.int2(raf);
this.decimalScaleFactor = GribNumbers.int2(raf);
this.numberOfBits = raf.read();
this.originalType = raf.read();
}
代码示例来源:origin: Unidata/thredds
Type2(RandomAccessFile raf) throws IOException {
super(raf);
this.splittingMethod = raf.read();
this.missingValueManagement = raf.read();
this.primaryMissingValue = raf.readFloat();
this.secondaryMissingValue = raf.readFloat();
this.numberOfGroups = GribNumbers.int4(raf);
this.referenceGroupWidths = raf.read();
this.bitsGroupWidths = raf.read();
this.referenceGroupLength = GribNumbers.int4(raf);
this.lengthIncrement = raf.read();
this.lengthLastGroup = GribNumbers.int4(raf);
this.bitsScaledGroupLength = raf.read();
}
代码示例来源:origin: edu.ucar/netcdf
Object readFloatArray1D(int offsetInRecord) throws IOException {
int elementSizeInBytes = 4;
float[] array = new float[header.getNumDataRecords()];
this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord);
for (int i = 0; i < header.getNumDataRecords(); i++) {
this.raf.readFloat(array, i, 1);
this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes);
}
return (array);
}
代码示例来源:origin: edu.ucar/cdm
Object readFloatArray1D(int offsetInRecord) throws IOException {
int elementSizeInBytes = 4;
float[] array = new float[header.getNumDataRecords()];
this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord);
for (int i = 0; i < header.getNumDataRecords(); i++) {
this.raf.readFloat(array, i, 1);
this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes);
}
return (array);
}
代码示例来源:origin: Unidata/thredds
Object readFloatArray1D(int offsetInRecord) throws IOException {
int elementSizeInBytes = 4;
float[] array = new float[header.getNumDataRecords()];
this.raf.seek(header.getRecordSizeInBytes() * header.getNumHeaderRecords() + offsetInRecord);
for (int i = 0; i < header.getNumDataRecords(); i++) {
this.raf.readFloat(array, i, 1);
this.raf.skipBytes(header.getRecordSizeInBytes() - elementSizeInBytes);
}
return (array);
}
代码示例来源:origin: edu.ucar/cdm
dataFile.readFloat(data, 0, sizeX * sizeY);
if (gradsDDF.isYReversed()) {
int newLoc = 0;
代码示例来源:origin: Unidata/thredds
dataFile.readFloat(data, 0, sizeX * sizeY);
if (gradsDDF.isYReversed()) {
int newLoc = 0;
代码示例来源:origin: edu.ucar/netcdf
dataFile.readFloat(data, 0, sizeX * sizeY);
if (gradsDDF.isYReversed()) {
int newLoc = 0;
代码示例来源:origin: edu.ucar/netcdf
float f = raf.readFloat();
代码示例来源:origin: edu.ucar/cdm
float f = raf.readFloat();
代码示例来源:origin: Unidata/thredds
float f = raf.readFloat();
代码示例来源:origin: Unidata/thredds
float[] pa = new float[heapId.nelems];
raf.seek(ho.dataPos);
raf.readFloat(pa, 0, pa.length);
return Array.factory(dataType, new int[]{pa.length}, pa);
代码示例来源:origin: edu.ucar/cdm
float[] pa = new float[heapId.nelems];
raf.seek(ho.dataPos);
raf.readFloat(pa, 0, pa.length);
return Array.factory(dataType.getPrimitiveClassType(), new int[]{pa.length}, pa);
代码示例来源:origin: edu.ucar/netcdf
float[] pa = new float[heapId.nelems];
raf.seek(ho.dataPos);
raf.readFloat(pa, 0, pa.length);
return Array.factory(dataType.getPrimitiveClassType(), new int[]{pa.length}, pa);
代码示例来源:origin: Unidata/thredds
Type50002(RandomAccessFile raf) throws IOException {
this.referenceValue = raf.readFloat();
this.binaryScaleFactor = GribNumbers.int2(raf);
this.decimalScaleFactor = GribNumbers.int2(raf);
代码示例来源:origin: edu.ucar/cdm
raf.order(byteOrder);
raf.seek(chunk.getSrcPos());
raf.readFloat(pa, (int) chunk.getDestElem(), chunk.getNelems());
代码示例来源:origin: edu.ucar/netcdf
raf.order(byteOrder);
raf.seek(chunk.getSrcPos());
raf.readFloat(pa, (int) chunk.getDestElem(), chunk.getNelems());
内容来源于网络,如有侵权,请联系作者删除!