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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 8708
    
    6

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: writing .zip file into DataOutputStream
 
Similar Threads
jdk 1.5.zip
can some .zip files (not java classes) be included in WEB-INF/classes too ?
Beginner question: having DataOutputStream and RandomAccessFile
DataOutputStream
How to write zip files into another zip file..?