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

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

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

RandomAccessFile.writeLong介绍

[英]Writes a long to the file as eight bytes, high byte first.
[中]将long作为八个字节写入文件,首先是高字节。

代码示例

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

  1. /**
  2. * Write an array of longs
  3. *
  4. * @param pa write from this array
  5. * @param start starting with this element in the array
  6. * @param n write this number of elements
  7. * @throws IOException on read error
  8. */
  9. public final void writeLong(long[] pa, int start, int n) throws IOException {
  10. for (int i = 0; i < n; i++) {
  11. writeLong(pa[start + i]);
  12. }
  13. }

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

  1. /**
  2. * Write an array of longs
  3. *
  4. * @param pa write from this array
  5. * @param start starting with this element in the array
  6. * @param n write this number of elements
  7. * @throws IOException on read error
  8. */
  9. public final void writeLong(long[] pa, int start, int n) throws IOException {
  10. for (int i = 0; i < n; i++) {
  11. writeLong(pa[start + i]);
  12. }
  13. }

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

  1. /**
  2. * Write an array of longs
  3. *
  4. * @param pa write from this array
  5. * @param start starting with this element in the array
  6. * @param n write this number of elements
  7. * @throws IOException on read error
  8. */
  9. public final void writeLong(long[] pa, int start, int n) throws IOException {
  10. for (int i = 0; i < n; i++) {
  11. writeLong(pa[start + i]);
  12. }
  13. }

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

  1. /**
  2. * Write an array of longs
  3. *
  4. * @param pa write from this array
  5. * @param start starting with this element in the array
  6. * @param n write this number of elements
  7. * @throws IOException on read error
  8. */
  9. public final void writeLong(long[] pa, int start, int n) throws IOException {
  10. for (int i = 0; i < n; i++) {
  11. writeLong(pa[start + i]);
  12. }
  13. }

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

  1. /**
  2. * Converts the double argument to a <code>long</code> using the
  3. * <code>doubleToLongBits</code> method in class <code>Double</code>,
  4. * and then writes that <code>long</code> value to the file as an
  5. * 8-byte quantity, high byte first.
  6. *
  7. * @param v a <code>double</code> value to be written.
  8. * @throws IOException if an I/O error occurs.
  9. * @see java.lang.Double#doubleToLongBits(double)
  10. */
  11. public final void writeDouble(double v) throws IOException {
  12. writeLong(Double.doubleToLongBits(v));
  13. }

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

  1. /**
  2. * Converts the double argument to a <code>long</code> using the
  3. * <code>doubleToLongBits</code> method in class <code>Double</code>,
  4. * and then writes that <code>long</code> value to the file as an
  5. * 8-byte quantity, high byte first.
  6. *
  7. * @param v a <code>double</code> value to be written.
  8. * @throws IOException if an I/O error occurs.
  9. * @see java.lang.Double#doubleToLongBits(double)
  10. */
  11. public final void writeDouble(double v) throws IOException {
  12. writeLong(Double.doubleToLongBits(v));
  13. }

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

  1. /**
  2. * Converts the double argument to a <code>long</code> using the
  3. * <code>doubleToLongBits</code> method in class <code>Double</code>,
  4. * and then writes that <code>long</code> value to the file as an
  5. * 8-byte quantity, high byte first.
  6. *
  7. * @param v a <code>double</code> value to be written.
  8. * @throws IOException if an I/O error occurs.
  9. * @see java.lang.Double#doubleToLongBits(double)
  10. */
  11. public final void writeDouble(double v) throws IOException {
  12. writeLong(Double.doubleToLongBits(v));
  13. }

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

  1. /**
  2. * Converts the double argument to a <code>long</code> using the
  3. * <code>doubleToLongBits</code> method in class <code>Double</code>,
  4. * and then writes that <code>long</code> value to the file as an
  5. * 8-byte quantity, high byte first.
  6. *
  7. * @param v a <code>double</code> value to be written.
  8. * @throws IOException if an I/O error occurs.
  9. * @see java.lang.Double#doubleToLongBits(double)
  10. */
  11. public final void writeDouble(double v) throws IOException {
  12. writeLong(Double.doubleToLongBits(v));
  13. }

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

  1. raf.writeLong(pos);
  2. else {
  3. if (pos > Integer.MAX_VALUE)
  4. raf.writeLong(pos);
  5. else
  6. raf.writeInt((int) pos);

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

  1. raf.writeLong(pos);
  2. else {
  3. if (pos > Integer.MAX_VALUE)
  4. raf.writeLong(pos);
  5. else
  6. raf.writeInt((int) pos);

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

  1. raf.writeLong(pos);
  2. else {
  3. if (pos > Integer.MAX_VALUE)
  4. raf.writeLong(pos);
  5. else
  6. raf.writeInt((int) pos);

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

  1. raf.writeInt(version);
  2. long lenPos = raf.getFilePointer();
  3. raf.writeLong(0); // save space to write the length of the record section
  4. long countBytes = 0;
  5. int countRecords = 0;
  6. raf.writeLong(countBytes);

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

  1. raf.writeInt(version);
  2. long lenPos = raf.getFilePointer();
  3. raf.writeLong(0); // save space to write the length of the record section
  4. long countBytes = 0;
  5. int countRecords = 0;
  6. raf.writeLong(countBytes);

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

  1. long pos = raf.getFilePointer();
  2. if (largeFile)
  3. raf.writeLong(0); // come back to this later
  4. else
  5. raf.writeInt(0); // come back to this later

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

  1. long pos = raf.getFilePointer();
  2. if (largeFile)
  3. raf.writeLong(0); // come back to this later
  4. else
  5. raf.writeInt(0); // come back to this later

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

  1. long pos = raf.getFilePointer();
  2. if (largeFile)
  3. raf.writeLong(0); // come back to this later
  4. else
  5. raf.writeInt(0); // come back to this later

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

  1. raf.writeLong(0); // no record section

相关文章