migration from bufferedstream to datastream