File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes writing .zip file into DataOutputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "writing .zip file into DataOutputStream" Watch "writing .zip file into DataOutputStream" New topic
Author

writing .zip file into DataOutputStream

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi Folks,

my zip file is in my hard disk ("E:\\out_zip\\Out.zip") . i need to send this .zip file to the ServerSocket . so how can i write it into the DataOutputStream ? please can you tell me the way?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

DataOutputStream is a bad choice for writing a binary file:
A data output stream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in.

DataOutputStream

The cool thing about Java IO is that copying to a socket is the same as copying to a file or a pipe and so on. Have a look at this example.


[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: writing .zip file into DataOutputStream