Static Public Member Functions | |
final Object | decompressObject (byte[] array) throws IOException, ClassNotFoundException |
final byte[] | compressObject (Object obj) throws IOException |
final int | countBytes (Object obj) throws IOException |
Static Public Attributes | |
final int | CLEAN_INTERVAL = 10 |
final int | OBJECT = 0 |
final int | NULL = 1 |
final int | STRING_OBJECT = 2 |
final int | INTEGER_OBJECT = 3 |
final int | LONG_OBJECT = 4 |
final int | BOOLEAN_OBJECT = 5 |
Definition at line 42 of file CJDBCStream.java.
|
Compress an object from its java form to byte array
Definition at line 87 of file CJDBCStream.java. 00088 { 00089 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 00090 DeflaterOutputStream zip = new DeflaterOutputStream(bos, new Deflater( 00091 Deflater.BEST_COMPRESSION)); 00092 ObjectOutputStream oos = new ObjectOutputStream(zip); 00093 oos.writeObject(obj); 00094 oos.flush(); 00095 oos.close(); 00096 bos.close(); 00097 byte[] data = bos.toByteArray(); 00098 return data; 00099 }
|
|
Statistic method to count the number of bytes of a class.
Definition at line 108 of file CJDBCStream.java. 00109 { 00110 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 00111 ObjectOutputStream oos = new ObjectOutputStream(bos); 00112 oos.writeObject(obj); 00113 oos.flush(); 00114 oos.close(); 00115 bos.close(); 00116 return bos.size(); 00117 }
|
|
Decompress an object from its byte-compressed form to java object
Definition at line 68 of file CJDBCStream.java. 00070 { 00071 ByteArrayInputStream bos = new ByteArrayInputStream(array); 00072 InflaterInputStream zip = new InflaterInputStream(bos); 00073 ObjectInputStream oos = new ObjectInputStream(zip); 00074 Object obj = oos.readObject(); 00075 oos.close(); 00076 bos.close(); 00077 return obj; 00078 }
|
|
Identifier of a Definition at line 58 of file CJDBCStream.java. |
|
Clean the stream after CLEAN_INTERVAL call to writeUnshared Definition at line 45 of file CJDBCStream.java. |
|
Identifier of an Definition at line 54 of file CJDBCStream.java. |
|
Identifier of a Definition at line 56 of file CJDBCStream.java. |
|
Identifier of Definition at line 50 of file CJDBCStream.java. |
|
Identifier of an object on the stream Definition at line 48 of file CJDBCStream.java. |
|
Identifier of a Definition at line 52 of file CJDBCStream.java. |