public void sendFile(File file, DataOutputStream dos) throws IOException {
if(dos!=null&&file.exists()&&file.isFile())
{
dos = new DataOutputStream(wy);
FileInputStream input = new FileInputStream(file);
dos.writeLong(file.length());
System.out.println(file.getAbsolutePath());
int read = 0;
while ((read = input.read()) != -1)
dos.writeByte(read);
dos.flush();
input.close();
System.out.println("File successfully sent!");
}
}
W jaki sposób zrobić pobieranie w ten sposób wysłanego pliku?