Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

What does ZipEntry object represent (contain)? A whole file, including actual data or...?

Thread view: 
beginner16 - 01 Aug 2007 20:17 GMT
hello

1)
Does ZipEntry object represent the whole file ( including actual data
written in a file ) or does it contain just a description of a file
( name of the file, its length etc ), but not actual data?

2) Both BufferedWriter and OutputStreamWriter have writeLine() metods.
Is there any difference between the two methods? Perhaps writeLine()
in BufferedWriter writes the whole line at once while the other method
doesn't?
If so, how is it able to write the whole line at once?

thank you

cheers
Lothar Kimmeringer - 01 Aug 2007 20:48 GMT
> 1)
> Does ZipEntry object represent the whole file ( including actual data
> written in a file ) or does it contain just a description of a file
> ( name of the file, its length etc ), but not actual data?

You still read from the stream, so the ZipEntry can be seen
only as representation.

> 2) Both BufferedWriter and OutputStreamWriter have writeLine() metods.
> Is there any difference between the two methods?

The functionality is the same, System.getProperty("line.separator")
will be written to the underyling writer/stream.

> Perhaps writeLine()
> in BufferedWriter writes the whole line at once while the other method
> doesn't?

That would be flushing and has nothing to do with the functionality
of writeLine(). BufferedWriter only flushes the buffer if the buffer
is full or is told so explicitly. OutputStreamWriter is not buffering
anything so the line-separator will be written to the underlying
stream immediately.

> If so, how is it able to write the whole line at once?

Use PrintWriter.println and initialize the Writer with
autoflush being set to true.

Before asking more questions try reading the Javadocs first. The
aforementioned writers are quite good explained there.

Regards, Lothar
Signature

Lothar Kimmeringer                E-Mail: spamfang@kimmeringer.de
              PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                questions!

A. Bolmarcich - 01 Aug 2007 20:56 GMT
> hello
>
> 1)
> Does ZipEntry object represent the whole file ( including actual data
> written in a file ) or does it contain just a description of a file
> ( name of the file, its length etc ), but not actual data?

A ZipEntry object does not directly refer to the data stored for the
entry.  The data stored for a ZipEntry can be read using the InputStream
returned by the getInputStream(ZipEntry) method of ZipFile.

> 2) Both BufferedWriter and OutputStreamWriter have writeLine() metods.
> Is there any difference between the two methods? Perhaps writeLine()
> in BufferedWriter writes the whole line at once while the other method
> doesn't?
> If so, how is it able to write the whole line at once?

As far as I can tell neither java.io.BufferedWriter nor
java.io.OutputStreamWriter (nor any other standard java class) have a
writeLine method.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.