Inheritance diagram for edu.virtualschool.jco.JCOEncodedBytes:


Definition at line 13 of file JCOEncodedBytes.java.
Public Member Functions | |
| JCOEncodedBytes (byte[] bytes) | |
| JCOEncodedBytes (Serializable object) throws JCOFault | |
| final Object | decode () throws JCOFault |
Static Package Functions | |
| byte[] | objectToBytes (Serializable object) throws JCOFault |
Static Package Attributes | |
| final long | serialVersionUID = -3017285087236141065L |
|
|
Construct an instance with the specified bytes
Definition at line 19 of file JCOEncodedBytes.java.
00020 {
00021 super(bytes);
00022 }
|
|
|
Construct an instance with bytes computed by serializing the object provided.
Definition at line 29 of file JCOEncodedBytes.java. References edu.virtualschool.jco.JCOEncodedBytes.objectToBytes().
00030 {
00031 super(objectToBytes(object));
00032 }
|
|
|
Decode the receiver, returning the result of deserializing the receiver's byte content.
Definition at line 39 of file JCOEncodedBytes.java.
00040 {
00041 try
00042 {
00043 ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
00044 ObjectInputStream ois = new ObjectInputStream(bis);
00045 Object obj = ois.readObject();
00046 ois.close();
00047 return obj;
00048 }
00049 catch (IOException e)
00050 {
00051 throw new JCOFault(e);
00052 }
00053 catch (ClassNotFoundException e)
00054 {
00055 throw new JCOFault(e);
00056 }
00057 }
|
|
|
Internal utility for serializing objects to bytes.
Definition at line 64 of file JCOEncodedBytes.java. Referenced by edu.virtualschool.jco.JCOEncodedBytes.JCOEncodedBytes().
00066 {
00067 try
00068 {
00069 ByteArrayOutputStream bos = new ByteArrayOutputStream();
00070 ObjectOutputStream oos = new ObjectOutputStream(bos);
00071 oos.writeObject(object);
00072 oos.close();
00073 byte[] bytes = bos.toByteArray();
00074 return bytes;
00075 }
00076 catch (IOException e)
00077 {
00078 throw new JCOFault(e);
00079 }
00080 }
|
|
|
Required to support log-lived storage in serialized form Reimplemented from edu.virtualschool.jco.JCOGenericBytes. Definition at line 84 of file JCOEncodedBytes.java. |