That's a pleasure. Do show us the improved version.murali jackson wrote:Thanks All . . . It was very helpfull . . .
Campbell Ritchie wrote:That's a pleasure. Do show us the improved version.
Nonononononononono.murali jackson wrote:. . .. . .
Yesyesyesyesyesyes. Well done
Carey Brown wrote:You can send a file name but if your server and client are on two different machines that won't work. Otherwise you have to send all the bytes of the file. When doing this the typical approach is to load the file into a byte[] that can hold the whole file, then send the length of the array in the first four bytes followed by the buffer contents.
Carey Brown wrote:
How are the client and server supposed to communicate with each other? Sockets? HTTP? File name if they're on the same machine?
murali jackson wrote:Could you please share some sample code or tell me what class and methods i need to use to load the file to byte[].
There are three kinds of actuaries: those who can count, and those who can't.
Norm Radder wrote:Will the file contain binary data? For example line end chararcters.
Norm Radder wrote: Can SOAP handle binary data? The byte array could be Base64 encoded to ensure no binary data.
Campbell Ritchie wrote:What would be wrong with reading the entire text into a single String, creating a byte[] of the appropriate size, and using String#getBytes()? Apart from the problem of changing line ends, as noted in the documentation comment of my FileCopier class?
Norm Radder wrote:Can you state what you are trying to do again? The last bits of code were for a small, specific part of the project. Can you post a higher level description of what you are trying to do?
the client will request a file from the server
server will send the requested file
client will process
and save the file
in the form of byte[]
Norm Radder wrote:Do you have a protocol for the requests the client sends to the server and for how the server responds to the client?
Carey Brown wrote:How are the client and server supposed to communicate with each other? Sockets? HTTP? File name if they're on the same machine?
murali jackson wrote:I am thinking of using this method as a Webservice operation. So i thing the protocol would be SOAP. Whenever a client makes a request to this service method.
It will send the byte[] as response and Client will process the byte[] to get the file. Thanks !!!
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
|