java - buffered reader in managed bean -


in web app, beans have serializable. i'm wanting open couple of streams, input , output device, in @postconstruct , leave them open. however, streams aren't serializable. so, if bean serialized, happens streams? if make them transient, have restore them when bean deserialized? if so, simple checking stream null , reopening them if null? or, better open , close them every time read or write?

probably better approach customise serialisation, i.e. in writeobject flush buffers/close streams/write additional state/etc, in readobject restore original object state.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -