Guest User

Untitled

a guest
Nov 30th, 2021
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. Socket photoSocket = new Socket(picServerIP, picServerPort);
  2. DataOutputStream dos = new DataOutputStream(photoSocket.getOutputStream());
  3. FileInputStream fis = new FileInputStream(fileEntry.getPath());
  4. int size = fis.available();
  5.  
  6. byte[] data = new byte[size];
  7.    
  8. fis.read(data);
  9. dos.writeInt(size);
  10. dos.write(data);
  11.  
  12. sleep(500);
  13.  
  14. dos.flush();
  15. dos.close();
  16. fis.close();
  17. photoSocket.close();
Advertisement
Add Comment
Please, Sign In to add comment