KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > marshall > JavaObjectStreamFactory


1 package org.jboss.cache.marshall;
2
3 import org.jboss.util.stream.MarshalledValueInputStream;
4
5 import java.io.ByteArrayInputStream JavaDoc;
6 import java.io.IOException JavaDoc;
7 import java.io.ObjectInputStream JavaDoc;
8 import java.io.ObjectOutputStream JavaDoc;
9 import java.io.OutputStream JavaDoc;
10
11 /**
12  * @author Clebert Suconic
13  * @since 1.4.1
14  */

15 class JavaObjectStreamFactory implements ObjectStreamFactory
16 {
17
18    public ObjectInputStream JavaDoc createObjectInputStream(byte[] bytes) throws IOException JavaDoc
19    {
20       ByteArrayInputStream JavaDoc in = new ByteArrayInputStream JavaDoc(bytes);
21       return new MarshalledValueInputStream(in);
22    }
23
24    public ObjectOutputStream JavaDoc createObjectOutputStream(OutputStream JavaDoc out) throws IOException JavaDoc
25    {
26       return new ObjectOutputStream JavaDoc(out);
27    }
28
29 }
30
Popular Tags