Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/telefonicasoluciones/search/server/HLZipSocket.java


1   package com.telefonicasoluciones.search.server;
2   
3   /**
4    * Socket de flujo comprimido.
5    * Creation date: (17/04/2001 9:57:14)
6    *     
7    * @author: Bodhisatva
8    * ArtMedia Company
9    */
10  import java.io.*;
11  import java.util.zip.ZipInputStream;
12  import java.util.zip.ZipOutputStream;
13  import java.net.Socket;
14  
15  public class HLZipSocket extends Socket {
16    private InputStream in;
17    private OutputStream out;
18  public HLZipSocket() {
19    super();
20  }
21  public HLZipSocket(String host, int port) throws IOException {
22    super(host, port);
23  }
24  public synchronized void close() throws IOException {
25    OutputStream o = getOutputStream();
26    o.flush();
27    super.close();
28  }
29  public InputStream getInputStream() throws IOException {
30    if (in == null) {
31        in = new ZipInputStream(super.getInputStream());
32    }
33    return in;
34  }
35  public OutputStream getOutputStream() throws IOException {
36    if (out == null) {
37      out = new ZipOutputStream(super.getOutputStream());
38    }
39    return out;
40  }
41  }