Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deleting a saved object

 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
say you save an object onto the hard drive c: using ObjectOutputStream. How to you delete this object from your computer later?
 
Henry Wong
author
Marshal
Pie
Posts: 21000
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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.
 
Henry Wong
author
Marshal
Pie
Posts: 21000
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic