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

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

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

ObjectInputStream.readUnshared介绍

[英]Reads the next unshared object from the source stream.
[中]从源流读取下一个非共享对象。

代码示例

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

@Override
public Object readUnshared() throws IOException, ClassNotFoundException {
  return wrapped.readUnshared();
}

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

/** {@inheritDoc} */
public Object readObjectUnshared() throws IOException, ClassNotFoundException {
  return ois.readUnshared();
}

代码示例来源:origin: RuedigerMoeller/fast-serialization

@Override
public Object readUnshared() throws IOException, ClassNotFoundException {
  return wrapped.readUnshared();
}

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

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
  // We do unshared reads here to ensure we have our own clones of the byte[]s.
  encodedParams = (byte[]) s.readUnshared();
  encryptedContent = (byte[]) s.readUnshared();
  // These are regular shared reads because the algorithms used by a given stream are
  // almost certain to the be same for each object, and String is immutable anyway,
  // so there's no security concern about sharing.
  sealAlg = (String) s.readObject();
  paramsAlg = (String) s.readObject();
}

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

Object toSet = fieldDesc.isUnshared() ? readUnshared() : readObject();
if (toSet != null) {

代码示例来源:origin: jboss-remoting/jboss-marshalling

/** {@inheritDoc} */
public Object readObjectUnshared() throws IOException, ClassNotFoundException {
  return ois.readUnshared();
}

代码示例来源:origin: com.healthmarketscience.rmiio/rmiio

/**
 * Reads the next object from the given input stream.  The default
 * implementation uses {@link java.io.ObjectInputStream#readUnshared}.
 * Subclasses may choose to change this behavior by overriding this method.
 *
 * @param istream the input stream from which to read the next object
 * @return the next object read
 */
protected Object deserializeObject(ObjectInputStream istream)
 throws IOException, ClassNotFoundException
{
 return istream.readUnshared();
}

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

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
  // We do unshared reads here to ensure we have our own clones of the byte[]s.
  encodedParams = (byte[]) s.readUnshared();
  encryptedContent = (byte[]) s.readUnshared();
  // These are regular shared reads because the algorithms used by a given stream are
  // almost certain to the be same for each object, and String is immutable anyway,
  // so there's no security concern about sharing.
  sealAlg = (String) s.readObject();
  paramsAlg = (String) s.readObject();
}

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

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
  // We do unshared reads here to ensure we have our own clones of the byte[]s.
  encodedParams = (byte[]) s.readUnshared();
  encryptedContent = (byte[]) s.readUnshared();
  // These are regular shared reads because the algorithms used by a given stream are
  // almost certain to the be same for each object, and String is immutable anyway,
  // so there's no security concern about sharing.
  sealAlg = (String) s.readObject();
  paramsAlg = (String) s.readObject();
}

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

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
  // We do unshared reads here to ensure we have our own clones of the byte[]s.
  encodedParams = (byte[]) s.readUnshared();
  encryptedContent = (byte[]) s.readUnshared();
  // These are regular shared reads because the algorithms used by a given stream are
  // almost certain to the be same for each object, and String is immutable anyway,
  // so there's no security concern about sharing.
  sealAlg = (String) s.readObject();
  paramsAlg = (String) s.readObject();
}

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

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
  // We do unshared reads here to ensure we have our own clones of the byte[]s.
  encodedParams = (byte[]) s.readUnshared();
  encryptedContent = (byte[]) s.readUnshared();
  // These are regular shared reads because the algorithms used by a given stream are
  // almost certain to the be same for each object, and String is immutable anyway,
  // so there's no security concern about sharing.
  sealAlg = (String) s.readObject();
  paramsAlg = (String) s.readObject();
}

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

private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
  // We do unshared reads here to ensure we have our own clones of the byte[]s.
  encodedParams = (byte[]) s.readUnshared();
  encryptedContent = (byte[]) s.readUnshared();
  // These are regular shared reads because the algorithms used by a given stream are
  // almost certain to the be same for each object, and String is immutable anyway,
  // so there's no security concern about sharing.
  sealAlg = (String) s.readObject();
  paramsAlg = (String) s.readObject();
}

代码示例来源:origin: com.squareup/tape

/** Deserialize a stream to an object. */
@SuppressWarnings("unchecked")
private T deserialize(InputStream in) throws IOException {
 ObjectInputStream oin = new ObjectInputStream(new BufferedInputStream(in, 1024));
 T entry;
 try {
  entry = (T) oin.readUnshared();
 } catch (ClassNotFoundException e) {
  // This can only happen if we make an incompatible change.
  throw new AssertionError(e);
 }
 return entry;
}

代码示例来源:origin: skjolber/external-nfc-api

private void readObject(java.io.ObjectInputStream in)
    throws java.io.IOException, ClassNotFoundException {
  apdu = (byte[])in.readUnshared();
  // initialize transient fields
  parse();
}

代码示例来源:origin: skjolber/external-nfc-api

private void readObject(java.io.ObjectInputStream in)
    throws java.io.IOException, ClassNotFoundException {
  apdu = (byte[])in.readUnshared();
  check(apdu);
}

代码示例来源:origin: skjolber/external-nfc-api

private void readObject(java.io.ObjectInputStream in)
    throws java.io.IOException, ClassNotFoundException {
  apdu = (byte[])in.readUnshared();
  check(apdu);
}

代码示例来源:origin: skjolber/external-nfc-api

private void readObject(java.io.ObjectInputStream in)
    throws java.io.IOException, ClassNotFoundException {
  apdu = (byte[])in.readUnshared();
  // initialize transient fields
  parse();
}

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

private void readObject(java.io.ObjectInputStream in)
    throws java.io.IOException, ClassNotFoundException {
  apdu = (byte[])in.readUnshared();
  // initialize transient fields
  parse();
}

代码示例来源:origin: hazelcast/hazelcast-jet

private Object read(InputStream in, ClassLoader classLoader) throws IOException {
  try {
    ObjectInputStream objectInputStream = newObjectInputStream(classLoader, classFilter, in);
    if (shared) {
      return objectInputStream.readObject();
    }
    return objectInputStream.readUnshared();
  } catch (ClassNotFoundException e) {
    throw new HazelcastSerializationException(e);
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

private Object read(InputStream in, ClassLoader classLoader) throws IOException {
  try {
    ObjectInputStream objectInputStream = newObjectInputStream(classLoader, classFilter, in);
    if (shared) {
      return objectInputStream.readObject();
    }
    return objectInputStream.readUnshared();
  } catch (ClassNotFoundException e) {
    throw new HazelcastSerializationException(e);
  }
}

相关文章

ObjectInputStream类方法