aspose file tools*
The moose likes Beginning Java and the fly likes deleting a saved object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "deleting a saved object" Watch "deleting a saved object" New topic
Author

deleting a saved object

Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

say you save an object onto the hard drive c: using ObjectOutputStream. How to you delete this object from your computer later?


Jesus lives
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18840
    
  40

Originally posted by Nikos Katsikanis:
say you save an object onto the hard drive c: using ObjectOutputStream. How to you delete this object from your computer later?


ObjectOutputStream is just a filter stream, but since you mentioned hard drive, I am going to assume that the ObjectOutputStream is using a FileOutputStream.

The result should just be a file -- you can delete it just like any other file.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
[Henry]: ObjectOutputStream is just a filter stream

That's a bit misleading, since it's not a FilterOutputStream. I would call it a top-level stream, but I don't know how common or standard that terminology is. The point is that it always writes to some other lower-level stream, which controls where the bytes actually go. E.g, if you write to a FileOutputStream, the bytes end up in a file.


"I'm not back." - Bill Harding, Twister
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18840
    
  40

Originally posted by Jim Yingst:
That's a bit misleading, since it's not a FilterOutputStream. I would call it a top-level stream, but I don't know how common or standard that terminology is. The point is that it always writes to some other lower-level stream, which controls where the bytes actually go. E.g, if you write to a FileOutputStream, the bytes end up in a file.[/QB]



Wow... I have always thought that the object output stream was a filter stream. Wasn't having a problem with terminology, I was just wrong!

Learn something new everyday...

Henry
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
[Henry]: Wasn't having a problem with terminology

Yeah, I figured something like that; the more careful explanation of the terminology was for whoever else reads this, since it's in JiG Beginner.
Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

ok guys thanks for the help, I'll be able to delete that file now, although give me some months before I can understand the rest of the conversation!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deleting a saved object