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

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

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

RandomAccessFile.readUnsignedShort介绍

[英]Reads an unsigned 16-bit number from this file. This method reads two bytes from the file. If the bytes read, in order, are b1 and b2, where 0 <= b1, b2 <= 255, then the result is equal to:

(b1 << 8) | b2

This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.
[中]从该文件中读取一个无符号的16位数字。此方法从文件中读取两个字节。如果按顺序读取的字节为b1b2,其中0 <= b1, b2 <= 255,则结果等于:
(b1 << 8) | b2
此方法会一直阻塞,直到读取两个字节、检测到流结束或引发异常为止。

代码示例

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

SweepInfo(RandomAccessFile din, int hoff ) throws IOException {
  din.seek(hoff);
  amb = din.readByte();
  arotate = (short)din.readUnsignedShort();
  pref1 = (short)din.readUnsignedShort();
  pref2 = (short)din.readUnsignedShort();
  spulseW = (short)din.readUnsignedShort();
  maxV = (short)din.readUnsignedShort();
  maxL = (short)din.readUnsignedShort();
  binWidth = (short)din.readUnsignedShort();
  binnumber = (short)din.readUnsignedShort();
  recordnumber = (short)din.readUnsignedShort();
  elevationAngle  = (short)din.readUnsignedShort()/100.0f;
 }
}

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

numPV = new int[numPts];
for (int i = 0; i < numPts; i++) {
 numPV[i] = raf.readUnsignedShort();

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

short syear = (short)din.readUnsignedShort();
short smm = convertunsignedByte2Short(din.readByte());
short sdd = convertunsignedByte2Short(din.readByte());
for(int i = 0; i < sweepN; i++) {
 din.skipBytes(14);
 int zbinWidth =  din.readUnsignedShort();
 int vbinWidth =  din.readUnsignedShort();
 int sbinWidth =  din.readUnsignedShort();
 int zbinNum =   din.readUnsignedShort();
 int vbinNum =   din.readUnsignedShort();
 int sbinNum =   din.readUnsignedShort();
 recordNum[i] = din.readUnsignedShort();
syear = (short)din.readUnsignedShort();
smm = convertunsignedByte2Short(din.readByte());
sdd = convertunsignedByte2Short(din.readByte());

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

short sRHIA= (short)din.readUnsignedShort();
echoType = din.readUnsignedShort();
if(echoType != 0x408a) //only support vppi at this moment
 throw new IOException("Error reading CINRAD CC data: Unsupported level 2 data");
int prodCode = din.readUnsignedShort();
 int maxV =  din.readUnsignedShort();
 int maxL =  din.readUnsignedShort();
 int binWidth =  din.readUnsignedShort();
 int binNum =   din.readUnsignedShort();
 int recordTotalNum = din.readUnsignedShort();
 din.skipBytes(8);
 elev[i] = din.readUnsignedShort();
 din.skipBytes(2);

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

azimuth_ang = din.readUnsignedShort(); // LOOK why unsigned ??

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

azimuth_ang = din.readUnsignedShort(); // LOOK why unsigned ??

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

azimuth_ang = din.readUnsignedShort(); // LOOK why unsigned ??

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

data_julian_date = (short) bytesToShort(b2, true); //din.readShort(); // prob "collection time"
azimuth_ang = din.readUnsignedShort(); // LOOK why unsigned ??
din.seek(message_offset);
azimuth_ang = din.readUnsignedShort(); // LOOK why unsigned ??
elevation_ang = (short)din.readUnsignedShort();
azimuth_ang_end = din.readUnsignedShort(); // LOOK why unsigned ??
elevation_ang_end = (short)din.readUnsignedShort();
radial_num = (short)(record % 360 + 1); // radial number within the elevation
azimuth_ang = din.readUnsignedShort();

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

short syear = (short)din.readUnsignedShort();
short smm = convertunsignedByte2Short(din.readByte());
short sdd = convertunsignedByte2Short(din.readByte());
syear = (short)din.readUnsignedShort();
smm = convertunsignedByte2Short(din.readByte());
sdd = convertunsignedByte2Short(din.readByte());

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

data_julian_date  = (short)bytesToShort(b2, true); //din.readShort(); // prob "collection time"
azimuth_ang   = din.readUnsignedShort(); // LOOK why unsigned ??

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

java.util.Date dd =  getDate();
azimuth_ang   = din.readUnsignedShort(); // LOOK why unsigned ??

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

olonPts[i] = raf.readUnsignedShort();
if (maxPts < olonPts[i]) {
 maxPts = olonPts[i];

相关文章