/***********************
file送受信プログラム
file sender
***********************/
//パッケージのインポート
import java.io.*;
import java.net.*;


class Sender{
	public static void main(String[] args){
		//接続用ソケット
		Socket socket;
		//ファイル入力ストリームの生成
		FileInputStream  in  = null;	
		//出力ストリーム
		OutputStream out;
		try{
			//ファイルオブジェクトの作成
			File iFile = new File("baby.jpg");
			//文字ストリームの作成
			in = new FileInputStream(iFile);
			
			//ソケット接続
			socket = new Socket("192.168.9.8",5678);
			//出力ストリーム
			out = socket.getOutputStream();
			//file読み込み&出力
			int c;
			while ((c = in.read()) != -1) {
				out.write(c);
			}
			
			//閉じる
			out.close();
			socket.close();
		}catch(Exception e){}
		
	}
}