Code example for ObjectOutputStream

Methods: closewriteObject

0
	public JavaSerializer(ClassLoader loader) {
		_loader = loader;
	} 
 
	public void writeObject(OutputStream stream, Object object) throws IOException {
		ObjectOutputStream objects = new ObjectOutputStream(stream);
		objects.writeObject(object);
		objects.close();
	} 
 
	public Object readObject(InputStream stream) throws IOException, ClassNotFoundException {
		ObjectInputStream objects = new ObjectInputStreamWithClassLoader(stream, _loader);
		Object object = objects.readObject();
		objects.close();
		return object;
	} 
 
} 
Connect your IDE to all the code out there  Get Codota for Java