Created
January 18, 2021 12:26
-
-
Save AntonioDiaz/aee8956e9aa5c300f76e82438d810f7a to your computer and use it in GitHub Desktop.
generateInputStream for testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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