Replace streaming API with block encode/decode routines