@Override public String readLine() throws IOException { return wrapped.readLine(); }
/** {@inheritDoc} */ @Override public String readLine() throws IOException { return ois.readLine(); }
/** {@inheritDoc} */ @Override public String readLine() throws IOException { return ois.readLine(); }
@Override public String readLine() throws IOException { return wrapped.readLine(); }
/** {@inheritDoc} */ @Deprecated public String readLine() throws IOException { return ois.readLine(); }
/** {@inheritDoc} */ @Override public String readLine() throws IOException { return ois.readLine(); }
/** {@inheritDoc} */ @Override public String readLine() throws IOException { return ois.readLine(); }
/** {@inheritDoc} */ @Deprecated public String readLine() throws IOException { return ois.readLine(); }
/** {@inheritDoc} */ @Deprecated public String readLine() throws IOException { return ois.readLine(); }
/** {@inheritDoc} */ @Deprecated public String readLine() throws IOException { return ois.readLine(); }
/** {@inheritDoc} */ @Deprecated public String readLine() throws IOException { return ois.readLine(); }
@Deprecated @Override public String readLine() throws IOException { return this.raw.readLine(); }
/** {@inheritDoc} */ @Deprecated public String readLine() throws IOException { return ois.readLine(); }
//Writting ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream("person.out")); outputStream.writeObject(person); PrintStream pst = new PrintStream(outputStream); pst.append("Some static Value"); outputStream.flush(); outputStream.close(); pst.close(); // Reading ObjectInputStream in = new ObjectInputStream(new FileInputStream("person.out")); Perrson person=(Person) in.readObject(); String staticText =in.readLine(); in.close();
final Socket client = serverSocket.accept(); //will set the client variable to whoever connects final ObjectInputStream in = new ObjectInputStream(client.getInputStream()); //for getting client's input ObjectOutputStream out = new ObjectOutputStream(client.getOutputStream()); //for sending objects to the client BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); //for reading in from server's console String input; while((input = stdIn.readLine()) != null) { //will read in from console out.writeObject(input); //will send console output to connected client } new Thread(new Runnable() { public void run() { Object objIn; while(!client.isClosed()) { if((objIn = in.readLine()) != null) { System.out.println("From client: " + objIn.toString()); } } } }).start();
try { URL urlServlet = new URL("uri for your servlet"); URLConnection con = urlServlet.openConnection(); con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); con.setRequestProperty( "Content-Type", "application/x-java-serialized-object"); // send data to the servlet OutputStream outstream = con.getOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(outstream); oos.writeObject(uuid); oos.flush(); oos.close(); // receive result from servlet InputStream instr = con.getInputStream(); ObjectInputStream inputFromServlet = new ObjectInputStream(instr); String name = con.getHeaderField("filename"); File fi = new File(name); int i = 0; while ((i = inputFromServlet.read()) != -1) { System.out.println(inputFromServlet.readLine()); } inputFromServlet.close(); instr.close(); } catch (Exception ex) { ex.printStackTrace(); }