Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1.  
  2. public void sendPicture(String picture) {
  3.  
  4. String pic = picture;
  5.  
  6. try {
  7. try (Socket client = new Socket(ip, portNumber);)
  8. {
  9. System.out.print("Connection! ");
  10. writer = new PrintStream(client.getOutputStream());
  11. System.out.print("Sending string: " + pic);
  12. writer.write(pic.getBytes());
  13.  
  14. }
  15.  
  16. } catch (IOException e) { //
  17. System.out.println("Error" + e);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement