add a stream like type and change toASN1 to use this.