java.io.ObjectOutputStream.checkWritePrimitiveTypes()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(105)

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

ObjectOutputStream.checkWritePrimitiveTypes介绍

[英]Do the necessary work to see if the receiver can be used to write primitive types like int, char, etc.
[中]做必要的工作,看看接收器是否可以用来编写int、char等基本类型。

代码示例

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

/**
 * Writes a double (64 bit) to the target stream.
 *
 * @param value
 *            the double to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeDouble(double value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeDouble(value);
}

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

/**
 * Writes a long (64 bit) to the target stream.
 *
 * @param value
 *            the long to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeLong(long value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeLong(value);
}

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

/**
 * Writes a boolean to the target stream.
 *
 * @param value
 *            the boolean value to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeBoolean(boolean value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeBoolean(value);
}

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

/**
 * Writes an integer (32 bit) to the target stream.
 *
 * @param value
 *            the integer to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeInt(int value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeInt(value);
}

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

/**
 * Writes a short (16 bit) to the target stream.
 *
 * @param value
 *            the short to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeShort(int value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeShort(value);
}

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

/**
 * Writes a byte (8 bit) to the target stream.
 *
 * @param value
 *            the byte to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeByte(int value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeByte(value);
}

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

/**
 * Writes a character (16 bit) to the target stream.
 *
 * @param value
 *            the character to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeChar(int value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeChar(value);
}

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

/**
 * Writes a float (32 bit) to the target stream.
 *
 * @param value
 *            the float to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeFloat(float value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeFloat(value);
}

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

/**
 * Writes the string {@code value} as a sequence of bytes to the target
 * stream. Only the least significant byte of each character in the string
 * is written.
 *
 * @param value
 *            the string to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeBytes(String value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeBytes(value);
}

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

/**
 * Writes a single byte to the target stream. Only the least significant
 * byte of the integer {@code value} is written to the stream. Blocks until
 * the byte is actually written.
 *
 * @param value
 *            the byte to write.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
@Override
public void write(int value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.write(value);
}

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

/**
   * Writes a string encoded with {@link DataInput modified UTF-8} to the
   * target stream.
   *
   * @param value
   *            the string to write to the target stream.
   * @throws IOException
   *             if an error occurs while writing to the target stream.
   */
  public void writeUTF(String value) throws IOException {
    checkWritePrimitiveTypes();
    primitiveTypes.writeUTF(value);
  }
}

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

/**
 * Writes {@code count} bytes from the byte array {@code buffer} starting at
 * offset {@code index} to the target stream. Blocks until all bytes are
 * written.
 *
 * @param buffer
 *            the buffer to write.
 * @param offset
 *            the index of the first byte in {@code buffer} to write.
 * @param length
 *            the number of bytes from {@code buffer} to write to the output
 *            stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
@Override
public void write(byte[] buffer, int offset, int length) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.write(buffer, offset, length);
}

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

/**
 * Writes the string {@code value} as a sequence of characters to the target
 * stream.
 *
 * @param value
 *            the string to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeChars(String value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeChars(value);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Writes a boolean to the target stream.
 *
 * @param value
 *            the boolean value to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeBoolean(boolean value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeBoolean(value);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Writes a byte (8 bit) to the target stream.
 *
 * @param value
 *            the byte to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeByte(int value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeByte(value);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Writes a float (32 bit) to the target stream.
 *
 * @param value
 *            the float to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeFloat(float value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeFloat(value);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Writes a character (16 bit) to the target stream.
 *
 * @param value
 *            the character to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeChar(int value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeChar(value);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Writes a double (64 bit) to the target stream.
 *
 * @param value
 *            the double to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeDouble(double value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeDouble(value);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Writes a float (32 bit) to the target stream.
 *
 * @param value
 *            the float to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeFloat(float value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeFloat(value);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Writes a short (16 bit) to the target stream.
 *
 * @param value
 *            the short to write to the target stream.
 * @throws IOException
 *             if an error occurs while writing to the target stream.
 */
public void writeShort(int value) throws IOException {
  checkWritePrimitiveTypes();
  primitiveTypes.writeShort(value);
}

相关文章

ObjectOutputStream类方法