Oh, I see, that's true. In that case I'd actually make an OutputStream subclass that wraps around ObjectOutput's write(byte[]) method. I still think it's worth it compared to materializing a big byte array in memory.