Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

copying files over the internet with sockets

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to write a program (client and server side) which takes a file name and sense the file via a socket connection to another address. For example, I might want to send a pdf file across a network. A google search gave quickly gave me a way of copying methods from one location to another on my own computer simply using InputStream and OutputStream. When trying to send files over the Net i quickly confused myself with all the different kinds of streams. Is it possible to write everything with output stream?
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is it possible to write everything with output stream?



I don't see why not. Serializing objects is what most people use to transfer data or files over the network using sockets. The problem may become the network cuts off during the transfer or the client can't get the whole file. So splitting the file into chunks of bytes is more appropriate.
reply
    Bookmark Topic Watch Topic
  • New Topic