Introduced TwoPhaseBufferedInputStream to decoding. Modifying jpeg built-in decoder.