All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.shaka.http.IO.scala Maven / Gradle / Ivy

package io.shaka.http

import java.io.InputStream
import scala.collection.mutable.ListBuffer

object IO {
  def inputStreamToByteArray(is: InputStream): Array[Byte] = {
    val buf = ListBuffer[Byte]()
    var b = is.read()
    while (b != -1) {
      buf.append(b.byteValue)
      b = is.read()
    }
    buf.toArray
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy