Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java And Socket: How to compress the received data

Java And Socket: How to compress the received data

import java.io.BufferedReader;
import java.io.FileReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.zip.GZIPInputStream;
public class GZIPSock
  public static void main(String[] args) throws Exception
    ServerSocket server_sock = new ServerSocket(1024);
    System.out.println ("Le Serveur est lancé....");
    Socket sock = server_sock.accept();
    GZIPInputStream zip = new GZIPInputStream(sock.getInputStream());
    while (true)
      int data;
      data = zip.read();
      if (data == -1)
      System.out.print((char) data);

Users who found this page were searching for:

  • python expression list
  • how to extract url in python
  • java find usb device
  • get dictionary key by value python
  • check if key already exist in hash in perl
  • Collections.BinarySearch on a linkedlist java
  • python delete entry dictionary

No comments yet.

Leave a Comment