Example usage for java.io Externalizable readExternal

List of usage examples for java.io Externalizable readExternal

Introduction

In this page you can find the example usage for java.io Externalizable readExternal.

Prototype

void readExternal(ObjectInput in) throws IOException, ClassNotFoundException;

Source Link

Document

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

Usage

From source file:org.codehaus.wadi.core.util.Utils.java

public static Externalizable setContent(Externalizable object, byte[] content, Streamer streamer)
        throws IOException, ClassNotFoundException {
    ByteArrayInputStream bais = new ByteArrayInputStream(content);
    ObjectInput oi = streamer.getInputStream(bais);
    object.readExternal(oi);
    oi.close();//from  w w w .  j a  va 2s.c  om
    return object;
}