I just think you shouldn't be calling .close in your streamings at all:
Can't you just do:
public void write(Object dataObject, OutputStream output) throws IOException
| {
| if(cipher == null)
| throw new IllegalStateException("Cipher is null for algo="+
this.cipherAlgorithm);
| output.flush();
|
| CipherOutputStream cos = new CipherOutputStream(output, cipher);
|
| SerializationManager sm =
SerializationStreamFactory.getManagerInstance(getSerializationType()
| );
| ObjectOutputStream oos = sm.createOutput(cos);
|
| if(wrappedMarshaller != null)
| {
| wrappedMarshaller.write(dataObject, oos);
| }
| else
| {
| super.write(dataObject, oos);
| }
| oos.flush();
| // cos.close(); pp remove this and let GC take care of these instances
| // oos.close(); //There is a need to close cos
| }
|
Take a look on the other marshallers... they always keep the streaming opened and only use
flush();
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965297#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...