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
{filelink=8992}

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)
        break;
      System.out.print((char) data);
    }
  }
}

Users who found this page were searching for:

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

No comments yet.

Leave a Comment