1

I was having trouble appending object file in my program. I found this SO answer.

However, I do not know how to subclass an AppendableObjectOutputStream. Can anyone kindly teach me how in more detail?

Community
  • 1
  • 1
LulalaBoss
  • 127
  • 1
  • 9
  • 1
    AppendableObjectOutputStream is already a subclass of ObjectOutputStream. What you really need? – Luiggi Mendoza Jun 15 '12 at 00:52
  • so you mean I can just use like AppendableObjectOutputStream oos = new AppendableObjectOutputStream(bout); ? – LulalaBoss Jun 15 '12 at 00:58
  • 1
    Yes, you can. You can create new instances of any class that is not marked as abstract. So you can copy/pase the code in your application and don't forget to implement the `writeStreamHeader` method. – Luiggi Mendoza Jun 15 '12 at 01:08

1 Answers1

1
class YourClass extends AppendableObjectOutputStream {
// any constructors required, if no default for Appendable
    public AppendableObjectOutputStream(<your args here>) {
        super(<other args here>);
    }
// any methods you want to @Override here
}
Steve H.
  • 6,912
  • 2
  • 30
  • 49