test: refactor reader stream to decoder
decoder: complete refactor of reader stream as decoder
encoder: [patch] make consistent with decoder