java.io.RandomAccessFile.writeFloat()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(104)

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

RandomAccessFile.writeFloat介绍

[英]Writes a big-endian 32-bit float to this file, starting at the current file pointer. The bytes are those returned by Float#floatToIntBits(float), meaning a canonical NaN is used.
[中]从当前文件指针开始,向该文件写入一个大端32位浮点。这些字节是由Float#floatToIntBits(Float)返回的字节,这意味着使用规范的NaN。

代码示例

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

@Override
public Bytes writeFloat(int offset, float f) {
 checkWrite(offset, FLOAT);
 try {
  seekToOffset(offset);
  randomAccessFile.writeFloat(f);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return this;
}

代码示例来源:origin: apache/activemq

@Override
public void writeFloat(float v) throws IOException {
  try {
    getRaf().writeFloat(v);
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

代码示例来源:origin: i2p/i2p.i2p

public void writeFloat(float v)		throws IOException { delegate.writeFloat(v); }
public void writeDouble(double v)	throws IOException { delegate.writeDouble(v); }

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

raf.writeLong((Long) value);
} else if (binding == Float.class || binding == float.class) {
  raf.writeFloat((Float) value);
} else if (binding == Double.class || binding == double.class) {
  raf.writeDouble((Double) value);

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.vfs

public void writeFloat(float v) throws IOException
{
  raf.writeFloat(v);
}

代码示例来源:origin: com.github.abashev/commons-vfs2

@Override
public void writeFloat(final float v) throws IOException {
  raf.writeFloat(v);
}

代码示例来源:origin: org.openmicroscopy/ome-common

@Override
public void writeFloat(float v) throws IOException {
 raf.writeFloat(v);
}

代码示例来源:origin: org.jetbrains.intellij.deps/commons-vfs2

@Override
public void writeFloat(final float v) throws IOException
{
  raf.writeFloat(v);
}

代码示例来源:origin: com.senseidb/sensei-core

@Override
 public void update(RandomAccessFile storedFile, int offset) {
  try {
   storedFile.seek(offset);
   storedFile.writeFloat(value);
  } catch (IOException e) {
   throw new RuntimeException(e);
  }
 }
}

代码示例来源:origin: ujmp/universal-java-matrix-package

public synchronized void writeFloat(long seek, float value) throws IOException {
  super.seek(seek);
  super.writeFloat(value);
  buffer.clear();
}

代码示例来源:origin: io.atomix/atomix-storage

@Override
public Bytes writeFloat(int offset, float f) {
 checkWrite(offset, FLOAT);
 try {
  seekToOffset(offset);
  randomAccessFile.writeFloat(f);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return this;
}

代码示例来源:origin: io.atomix.catalyst/catalyst-buffer

@Override
public Bytes writeFloat(long offset, float f) {
 checkWrite(offset, FLOAT);
 try {
  seekToOffset(offset);
  randomAccessFile.writeFloat(f);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return this;
}

代码示例来源:origin: io.atomix/catalyst-buffer

@Override
public Bytes writeFloat(long offset, float f) {
 checkWrite(offset, FLOAT);
 try {
  seekToOffset(offset);
  randomAccessFile.writeFloat(f);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return this;
}

代码示例来源:origin: atomix/catalyst

@Override
public Bytes writeFloat(long offset, float f) {
 checkWrite(offset, FLOAT);
 try {
  seekToOffset(offset);
  randomAccessFile.writeFloat(f);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return this;
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

@Override
public Bytes writeFloat(long offset, float f) {
 checkWrite(offset, FLOAT);
 try {
  seekToOffset(offset);
  randomAccessFile.writeFloat(f);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return this;
}

代码示例来源:origin: io.atomix/atomix-buffer

@Override
public Bytes writeFloat(int offset, float f) {
 checkWrite(offset, FLOAT);
 try {
  seekToOffset(offset);
  randomAccessFile.writeFloat(f);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return this;
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public void writeFloat(float v) throws IOException {
  try {
    getRaf().writeFloat(v);
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

代码示例来源:origin: org.apache.activemq/activemq-kahadb-store

@Override
public void writeFloat(float v) throws IOException {
  try {
    getRaf().writeFloat(v);
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public void writeFloat(float v) throws IOException {
  try {
    getRaf().writeFloat(v);
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

代码示例来源:origin: octo-online/reactive-audit

@Test(expected = FileReactiveAuditException.class)
public void writeFloat()
    throws IOException
{
  ReactiveAudit.off.commit();
  try (RandomAccessFile rw = newRandomAccessFile())
  {
    TestTools.strict.commit();
    rw.writeFloat(0);
  }
}

相关文章