im writing a simple RSA encryption program that will send the coded message across a socket, but im getting an error on the output stream. I dont know if the class is getting passed the string correctly or if the output stream is just not working.
import java.util.*;
import java.lang.*;
import java.io.*;
import java.net.*;
public class connect{
public static Socket socket;
public connect(Socket t)
{
t = socket;
}
public void send(String msg)
{
try
{
OutputStream os = socket.getOutputStream();
PrintStream out = new PrintStream(os);
out.print(msg);
out.flush();
}catch(Exception e){System.out.println("Error on send : " + e.getMessage());}
}
}