/**
* inputStream to Array[Byte] method
**/
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
// Resource.fromInputStream(in).byteArray
}
import scala.collection.mutable.ListBuffer