title: Scala zio for ftp
body: <p>I want to do sftp in zio. I have this piece of code.</p>
  <pre><code>  val settings = SecureFtpSettings(&quot;anomymous&quot;, 22, FtpCredentials(&quot;anomymous&quot;, &quot;anomymous&quot;))
    val sftpLayer = secure(settings)
  
   override def run(args: List[String]): URIO[ZEnv, ExitCode] = program.exitCode
  
    val program =
      for {
        files   &lt;- connect(settings).use(_.readFile(filename).runCollect)
        lsStr   &lt;- UIO(files.fold(new StringBuilder()){ (sb, ss) =&gt; s&quot;${sb} ${ &quot;&quot; + ss}&quot; }.toString)
        _       &lt;- putStr(lsStr)
      } yield ()
  </code></pre>
  <p>When I try to read the contents of files (Chunk[Byte]), I get the output as bytes. Can anyone tell me a way of parsing a Chunk[Byte] to Strings in zio and save the contents of the file.</p>