I don't think you have missed something - I guess it's no so easy with standard java. But Shawn provided a class TemporaryBuffer.LocalFile which may be helpful. You may also decide to leave this optimization for the next proposal and stay with this temporary file for now.