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

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

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

RandomAccessFile.readFloat介绍

[英]Reads a big-endian 32-bit float from the current position in this file. Blocks until four bytes have been read, the end of the file is reached or an exception is thrown.
[中]从文件中的当前位置读取一个大端32位浮点。块,直到读取了四个字节,到达文件末尾或引发异常。

代码示例

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

@Override
public float readFloat(int offset) {
 checkRead(offset, FLOAT);
 try {
  seekToOffset(offset);
  return randomAccessFile.readFloat();
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
}

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

@Override
public float readFloat() throws IOException {
  try {
    return getRaf().readFloat();
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

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

public float readFloat()			throws IOException { return delegate.readFloat(); }
public void readFully(byte[] b)		throws IOException { delegate.readFully(b); }

代码示例来源:origin: ahmetaa/zemberek-nlp

public void getFloat(int index, float[] data) throws IOException {
 raf.seek(index * 4);
 for (int i = 0; i < data.length; i++) {
  data[i] = raf.readFloat();
 }
}

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

return raf.readLong();
} else if (binding == Float.class || binding == float.class) {
  return raf.readFloat();
} else if (binding == Double.class || binding == double.class) {
  return raf.readDouble();

代码示例来源:origin: topjohnwu/libsu

@Override
public float readFloat() throws IOException {
  return raf.readFloat();
}

代码示例来源:origin: ome/formats-common

@Override
public float readFloat() throws IOException {
 return raf.readFloat();
}

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

@Override
public float readFloat() throws IOException
{
  return raf.readFloat();
}

代码示例来源:origin: io.scif/scifio

@Override
public float readFloat() throws IOException {
  return raf.readFloat();
}

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

@Override
public float readFloat() throws IOException {
 return raf.readFloat();
}

代码示例来源:origin: org.apache.commons/commons-vfs2

@Override
public float readFloat() throws IOException {
  return raf.readFloat();
}

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

private float[] getFeature(int i) throws IOException {
  featureData.seek(i * (Long.SIZE + 128 * Float.SIZE));
  System.out.println(featureData.readLong());
  final float[] data = new float[128];
  for (int j = 0; j < 128; j++)
    data[j] = featureData.readFloat();
  return data;
}

代码示例来源:origin: org.openimaj/sandbox

private float[] getFeature(int i) throws IOException {
  featureData.seek(i * (Long.SIZE + 128 * Float.SIZE));
  System.out.println(featureData.readLong());
  final float[] data = new float[128];
  for (int j = 0; j < 128; j++)
    data[j] = featureData.readFloat();
  return data;
}

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

@Override
public float readFloat(long offset) {
 checkRead(offset, FLOAT);
 try {
  seekToOffset(offset);
  return randomAccessFile.readFloat();
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
}

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

@Override
public float readFloat(int offset) {
 checkRead(offset, FLOAT);
 try {
  seekToOffset(offset);
  return randomAccessFile.readFloat();
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
}

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

@Override
public float readFloat(long offset) {
 checkRead(offset, FLOAT);
 try {
  seekToOffset(offset);
  return randomAccessFile.readFloat();
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
}

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

@Override
public float readFloat() throws IOException {
  try {
    return getRaf().readFloat();
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

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

@Override
public float readFloat() throws IOException {
  try {
    return getRaf().readFloat();
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

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

@Override
public float readFloat() throws IOException {
  try {
    return getRaf().readFloat();
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

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

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

相关文章