java.io.ObjectInputStream.readStreamHeader()方法的使用及代码示例

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

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

ObjectInputStream.readStreamHeader介绍

[英]Reads and validates the ObjectInputStream header from the source stream.
[中]从源流读取并验证ObjectInputStream头。

代码示例

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

/**
 * Constructs a new ObjectInputStream that reads from the InputStream
 * {@code input}.
 *
 * @param input
 *            the non-null source InputStream to filter reads on.
 * @throws IOException
 *             if an error occurs while reading the stream header.
 * @throws StreamCorruptedException
 *             if the source stream does not contain serialized objects that
 *             can be read.
 */
public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException {
  this.input = (input instanceof DataInputStream)
      ? (DataInputStream) input : new DataInputStream(input);
  primitiveTypes = new DataInputStream(this);
  enableResolve = false;
  this.subclassOverridingImplementation = false;
  resetState();
  nestedLevels = 0;
  // So read...() methods can be used by
  // subclasses during readStreamHeader()
  primitiveData = this.input;
  // Has to be done here according to the specification
  readStreamHeader();
  primitiveData = emptyStream;
}

代码示例来源:origin: com.akiban/akiban-persistit

@Override
protected final void readStreamHeader() throws IOException {
  if (_classDescriptor == null)
    super.readStreamHeader();
}

代码示例来源:origin: stackoverflow.com

java.io.StreamCorruptedException: invalid stream header: EFBFBDEF
 at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
 at java.io.ObjectInputStream.<init>(ObjectInputStream.java:279)

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Constructs a new ObjectInputStream that reads from the InputStream
 * {@code input}.
 *
 * @param input
 *            the non-null source InputStream to filter reads on.
 * @throws IOException
 *             if an error occurs while reading the stream header.
 * @throws StreamCorruptedException
 *             if the source stream does not contain serialized objects that
 *             can be read.
 */
public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException {
  this.input = (input instanceof DataInputStream)
      ? (DataInputStream) input : new DataInputStream(input);
  primitiveTypes = new DataInputStream(this);
  enableResolve = false;
  this.subclassOverridingImplementation = false;
  resetState();
  nestedLevels = 0;
  // So read...() methods can be used by
  // subclasses during readStreamHeader()
  primitiveData = this.input;
  // Has to be done here according to the specification
  readStreamHeader();
  primitiveData = emptyStream;
}

代码示例来源:origin: com.jtransc/jtransc-rt

/**
 * Constructs a new ObjectInputStream that reads from the InputStream
 * {@code input}.
 *
 * @param input the non-null source InputStream to filter reads on.
 * @throws IOException              if an error occurs while reading the stream header.
 * @throws StreamCorruptedException if the source stream does not contain serialized objects that
 *                                  can be read.
 */
public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException {
  this.input = (input instanceof DataInputStream)
    ? (DataInputStream) input : new DataInputStream(input);
  primitiveTypes = new DataInputStream(this);
  enableResolve = false;
  this.subclassOverridingImplementation = false;
  resetState();
  nestedLevels = 0;
  // So read...() methods can be used by
  // subclasses during readStreamHeader()
  primitiveData = this.input;
  // Has to be done here according to the specification
  readStreamHeader();
  primitiveData = emptyStream;
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Constructs a new ObjectInputStream that reads from the InputStream
 * {@code input}.
 *
 * @param input
 *            the non-null source InputStream to filter reads on.
 * @throws IOException
 *             if an error occurs while reading the stream header.
 * @throws StreamCorruptedException
 *             if the source stream does not contain serialized objects that
 *             can be read.
 */
public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException {
  this.input = (input instanceof DataInputStream)
      ? (DataInputStream) input : new DataInputStream(input);
  primitiveTypes = new DataInputStream(this);
  enableResolve = false;
  this.subclassOverridingImplementation = false;
  resetState();
  nestedLevels = 0;
  // So read...() methods can be used by
  // subclasses during readStreamHeader()
  primitiveData = this.input;
  // Has to be done here according to the specification
  readStreamHeader();
  primitiveData = emptyStream;
}

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

/**
 * Constructs a new ObjectInputStream that reads from the InputStream
 * {@code input}.
 *
 * @param input
 *            the non-null source InputStream to filter reads on.
 * @throws IOException
 *             if an error occurs while reading the stream header.
 * @throws StreamCorruptedException
 *             if the source stream does not contain serialized objects that
 *             can be read.
 */
public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException {
  this.input = (input instanceof DataInputStream)
      ? (DataInputStream) input : new DataInputStream(input);
  primitiveTypes = new DataInputStream(this);
  enableResolve = false;
  this.subclassOverridingImplementation = false;
  resetState();
  nestedLevels = 0;
  // So read...() methods can be used by
  // subclasses during readStreamHeader()
  primitiveData = this.input;
  // Has to be done here according to the specification
  readStreamHeader();
  primitiveData = emptyStream;
}

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

/**
 * Constructs a new ObjectInputStream that reads from the InputStream
 * {@code input}.
 *
 * @param input
 *            the non-null source InputStream to filter reads on.
 * @throws IOException
 *             if an error occurs while reading the stream header.
 * @throws StreamCorruptedException
 *             if the source stream does not contain serialized objects that
 *             can be read.
 */
public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException {
  this.input = (input instanceof DataInputStream)
      ? (DataInputStream) input : new DataInputStream(input);
  primitiveTypes = new DataInputStream(this);
  enableResolve = false;
  this.subclassOverridingImplementation = false;
  resetState();
  nestedLevels = 0;
  // So read...() methods can be used by
  // subclasses during readStreamHeader()
  primitiveData = this.input;
  // Has to be done here according to the specification
  readStreamHeader();
  primitiveData = emptyStream;
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Constructs a new ObjectInputStream that reads from the InputStream
 * {@code input}.
 *
 * @param input
 *            the non-null source InputStream to filter reads on.
 * @throws IOException
 *             if an error occurs while reading the stream header.
 * @throws StreamCorruptedException
 *             if the source stream does not contain serialized objects that
 *             can be read.
 */
public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException {
  this.input = (input instanceof DataInputStream)
      ? (DataInputStream) input : new DataInputStream(input);
  primitiveTypes = new DataInputStream(this);
  enableResolve = false;
  this.subclassOverridingImplementation = false;
  resetState();
  nestedLevels = 0;
  // So read...() methods can be used by
  // subclasses during readStreamHeader()
  primitiveData = this.input;
  // Has to be done here according to the specification
  readStreamHeader();
  primitiveData = emptyStream;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Constructs a new ObjectInputStream that reads from the InputStream
 * {@code input}.
 *
 * @param input
 *            the non-null source InputStream to filter reads on.
 * @throws IOException
 *             if an error occurs while reading the stream header.
 * @throws StreamCorruptedException
 *             if the source stream does not contain serialized objects that
 *             can be read.
 */
public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException {
  this.input = (input instanceof DataInputStream)
      ? (DataInputStream) input : new DataInputStream(input);
  primitiveTypes = new DataInputStream(this);
  enableResolve = false;
  this.subclassOverridingImplementation = false;
  resetState();
  nestedLevels = 0;
  // So read...() methods can be used by
  // subclasses during readStreamHeader()
  primitiveData = this.input;
  // Has to be done here according to the specification
  readStreamHeader();
  primitiveData = emptyStream;
}

代码示例来源:origin: jtulach/bck2brwsr

vlist = new ValidationList();
enableOverride = false;
readStreamHeader();
bin.setBlockDataMode(true);

代码示例来源:origin: org.apidesign.bck2brwsr/emul

vlist = new ValidationList();
enableOverride = false;
readStreamHeader();
bin.setBlockDataMode(true);

相关文章

ObjectInputStream类方法