Variable all-optical buffering based on semiconductor optical amplifiers and its applications