クラス org.objectweb.cjdbc.common.stream.CJDBCStream

すべてのメンバ一覧

説明

This is a useful stream class to compress and decompress object to a stream.

作者:
Nicolas Modrzyk

CJDBCStream.java41 行で定義されています。

Static Public メソッド

final Object decompressObject (byte[] array) throws IOException, ClassNotFoundException
final byte[] compressObject (Object obj) throws IOException
final int countBytes (Object obj) throws IOException

Static Public 変数

int CLEAN_INTERVAL = 10


メソッド

final byte [] org.objectweb.cjdbc.common.stream.CJDBCStream.compressObject Object  obj  )  throws IOException [static]
 

Compress an object from its java form to byte array

引数:
obj to compress
戻り値:
byte array
例外:
IOException if fails to read
CJDBCStream.java74 行で定義されています。
00075 { 00076 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 00077 DeflaterOutputStream zip = new DeflaterOutputStream(bos, new Deflater( 00078 Deflater.BEST_COMPRESSION)); 00079 ObjectOutputStream oos = new ObjectOutputStream(zip); 00080 oos.writeObject(obj); 00081 oos.flush(); 00082 oos.close(); 00083 bos.close(); 00084 byte[] data = bos.toByteArray(); 00085 return data; 00086 }

final int org.objectweb.cjdbc.common.stream.CJDBCStream.countBytes Object  obj  )  throws IOException [static]
 

Statistic method to count the number of bytes of a class.

引数:
obj to count bytes
戻り値:
the number of bytes
例外:
IOException if fails to read
CJDBCStream.java95 行で定義されています。
00096 { 00097 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 00098 ObjectOutputStream oos = new ObjectOutputStream(bos); 00099 oos.writeObject(obj); 00100 oos.flush(); 00101 oos.close(); 00102 bos.close(); 00103 return bos.size(); 00104 }

final Object org.objectweb.cjdbc.common.stream.CJDBCStream.decompressObject byte[]  array  )  throws IOException, ClassNotFoundException [static]
 

Decompress an object from its byte-compressed form to java object

引数:
array of bytes
戻り値:
the object if it can be retrieved
例外:
IOException if fails to read
ClassNotFoundException if class of object does not exist
CJDBCStream.java55 行で定義されています。
00057 { 00058 ByteArrayInputStream bos = new ByteArrayInputStream(array); 00059 InflaterInputStream zip = new InflaterInputStream(bos); 00060 ObjectInputStream oos = new ObjectInputStream(zip); 00061 Object obj = oos.readObject(); 00062 oos.close(); 00063 bos.close(); 00064 return obj; 00065 }


変数

int org.objectweb.cjdbc.common.stream.CJDBCStream.CLEAN_INTERVAL = 10 [static]
 

Clean the stream after CLEAN_INTERVAL call to writeUnshared CJDBCStream.java45 行で定義されています。


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0.4に対してTue Oct 12 15:16:19 2004に生成されました。 doxygen 1.3.8