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?
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.