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

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

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

RandomAccessFile.writeBoolean介绍

[英]Writes a boolean to this file as a single byte (1 for true, 0 for false), starting at the current file pointer.
[中]将布尔值作为单个字节写入该文件(1表示真,0表示假),从当前文件指针开始。

代码示例

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

@Override
public void writeBoolean(boolean b) throws IOException {
  try {
    getRaf().writeBoolean(b);
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

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

public void writeBoolean(boolean v)	throws IOException { delegate.writeBoolean(v); }
public void writeByte(int v)		throws IOException { delegate.writeByte(v); }

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

void writeAttribute(AttributeDescriptor ad, Object value) throws IOException {
  if (value == null) {
    raf.writeBoolean(true);
  } else {
    raf.writeBoolean(false);
    Class<?> binding = ad.getType().getBinding();
    if (binding == Boolean.class) {
      raf.writeBoolean((Boolean) value);
    } else if (binding == Byte.class || binding == byte.class) {
      raf.writeByte((Byte) value);

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

@Override
public void writeBoolean(final boolean v) throws IOException {
  raf.writeBoolean(v);
}

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

@Override
public void writeBoolean(final boolean v) throws IOException
{
  raf.writeBoolean(v);
}

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

@Override
public void writeBoolean(boolean v) throws IOException {
 raf.writeBoolean(v);
}

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

@Override
public void writeBoolean(boolean v) throws IOException {
 raf.writeBoolean(v);
}

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

public void writeBoolean(boolean v) throws IOException
{
  raf.writeBoolean(v);
}

代码示例来源:origin: cc.plural/jsonij

@Override
public final void writeBoolean(boolean v) throws IOException {
  randomAccessFile.writeBoolean(v);
}

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

@Override
public void writeBoolean(final boolean v) throws IOException {
  raf.writeBoolean(v);
}

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

@Override
public void writeBoolean(final boolean v) throws IOException {
  raf.writeBoolean(v);
}

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

@Override
public void writeBoolean(final boolean v) throws IOException {
  raf.writeBoolean(v);
}

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

@Override
public void writeBoolean(boolean v) throws IOException {
  raf.writeBoolean(v);
}

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

@Override
public void writeBoolean(final boolean v) throws IOException {
  writer().writeBoolean(v);
}

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

@Override
public Bytes writeBoolean(long offset, boolean b) {
 checkWrite(offset, BOOLEAN);
 try {
  seekToOffset(offset);
  randomAccessFile.writeBoolean(b);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return this;
}

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

@Override
public Bytes writeBoolean(long offset, boolean b) {
 checkWrite(offset, BOOLEAN);
 try {
  seekToOffset(offset);
  randomAccessFile.writeBoolean(b);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return this;
}

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

@Override
public void writeBoolean(boolean b) throws IOException {
  try {
    getRaf().writeBoolean(b);
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

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

@Override
public void writeBoolean(boolean b) throws IOException {
  try {
    getRaf().writeBoolean(b);
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

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

@Override
public void writeBoolean(boolean b) throws IOException {
  try {
    getRaf().writeBoolean(b);
  } catch (IOException ioe) {
    handleException();
    throw ioe;
  }
}

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

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

相关文章