Hello everybody! (:
So I'm learning how to make programs to run online for the first time and I chose java as language.
I'm writing a simple code that uses a server and in the server class I use threads (1 for each client) to deal with the clients request...
But I don't know how to use very well those Input/Output Stream classes in java

I'm gonna post the code i'm writing but this is NOT a "what's wrong with my code" question, I just want to know some funcions that i'll need to use in order to transmit IMAGES from the server to the client...



import java.io.*;
import java.net.*;
import java.util.*;
import java.awt.*;
import javax.swing.*;
 
public class Server extends JFrame{
 
	private ServerSocket serverSocket;
	private Socket connection;
	private ArrayList<Socket> connections;
	private JTextArea sInfos;
	private int connectionsCount=0;
	private Image world;
 
	public Image getWorld() {
		return world;
	}
 
	public void setWorld(Image world) {
		this.world = world;
	}
 
 
 
	private ObjectOutputStream output;
	private ObjectInputStream input;
 
 
	public static void main(String[] args){
		Server server = new Server();
		server.startServer();
	}
 
	public Server(){
		super("Server");
		sInfos = new JTextArea();
		sInfos.setEditable(false);
		add(sInfos);
		setSize(500,400);
		setVisible(true);	
		world = new ImageIcon("./resource/ambiente.png").getImage();
	}
 
	public void startServer(){
		try{
			waitForConnection();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
 
 
 
	private void waitForConnection(){
		try{
			connection = serverSocket.accept();
			connections.add(connection);
			connectionsCount++;
			Thread t = new ThreadHandler(connections.get(connectionsCount),connectionsCount);
			t.run();
		}catch(Exception e){
			e.printStackTrace();
		}
 
	}
}
 
class ThreadHandler extends Thread{
 
	Socket newsock;
	int n;
	ObjectInputStream input;
	ObjectOutputStream output;
	Server server = new Server();
	ThreadHandler(Socket s, int v){
		newsock = s;
		n=v;
		try{
			input = new ObjectInputStream(newsock.getInputStream());
			output = new ObjectOutputStream(newsock.getOutputStream());
		}catch(Exception e){
 
		}
	}
	public void run(){
		try{
 
			/*
                          [COLOR="#FF0000"]HERE IS GOING TO BE THE MAIN LOOP THAT SENDS INFO (LIKE IMAGE FILES, ETC...) FROM THE SERVER TO THE CLIENT
USING THE OUTPUT OBJECT CREATED RIGHT ABOVE
 
                            WHAT ARE THE METHOD TO USE IN THIS CASE? AND HOW THE CLIENT WILL RECEIVE THEM?[/COLOR]
                        */
 
		}catch(Exception e){}
 
	}
 
}