クラス org.objectweb.cjdbc.common.stream.encoding.ZipEncoding

すべてのメンバ一覧

説明

This class defines ZipEncoding/Decoding methods

作者:
Nicolas Modrzyk
バージョン:
1.0

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

Static Public メソッド

final byte[] encode (byte[] data) throws IOException
final byte[] decode (byte[] data) throws IOException


メソッド

final byte [] org.objectweb.cjdbc.common.stream.encoding.ZipEncoding.decode byte[]  data  )  throws IOException [static]
 

Decode data using ZIP Decompression

引数:
data the encoded data
戻り値:
byte[] of decoded data
例外:
IOException if fails
ZipEncoding.java74 行で定義されています。
00075 { 00076 InflaterInputStream input = new InflaterInputStream( 00077 new ByteArrayInputStream((data))); 00078 ByteArrayOutputStream baos = new ByteArrayOutputStream(); 00079 00080 byte[] bdata = new byte[1024]; 00081 int byteCount; 00082 while ((byteCount = input.read(bdata, 0, 1024)) > -1) 00083 baos.write(bdata, 0, byteCount); 00084 baos.flush(); 00085 baos.close(); 00086 00087 return baos.toByteArray(); 00088 }

final byte [] org.objectweb.cjdbc.common.stream.encoding.ZipEncoding.encode byte[]  data  )  throws IOException [static]
 

Encode data using ZIP compression

引数:
data byte array to compress
戻り値:
byte[] of zip encoded data
例外:
IOException if fails reading/writing streams
ZipEncoding.java50 行で定義されています。
00051 { 00052 ByteArrayInputStream bais = new ByteArrayInputStream(data); 00053 ByteArrayOutputStream baos = new ByteArrayOutputStream(); 00054 BufferedOutputStream bos = new BufferedOutputStream( 00055 new DeflaterOutputStream(baos, new Deflater())); 00056 byte[] bdata = new byte[1024]; 00057 int byteCount; 00058 while ((byteCount = bais.read(bdata, 0, 1024)) > -1) 00059 { 00060 bos.write(bdata, 0, byteCount); 00061 } 00062 bos.flush(); 00063 bos.close(); 00064 return baos.toByteArray(); 00065 }


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