Skip to content

Instantly share code, notes, and snippets.

@AntonioDiaz
Created January 18, 2021 12:26
Show Gist options
  • Save AntonioDiaz/aee8956e9aa5c300f76e82438d810f7a to your computer and use it in GitHub Desktop.
Save AntonioDiaz/aee8956e9aa5c300f76e82438d810f7a to your computer and use it in GitHub Desktop.
generateInputStream for testing
private fun generateInputStream(): InputStream {
val bytesOutputStream = ByteArrayOutputStream()
val out = ZipOutputStream(bytesOutputStream, Charset.defaultCharset())
val writeEntry = ZipEntry("test.csv")
out.putNextEntry(writeEntry)
out.write("content".toByteArray())
out.closeEntry()
out.close()
return ByteArrayInputStream(bytesOutputStream.toByteArray())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment