Skip to content

Commit

Permalink
Added resourceToByteArray
Browse files Browse the repository at this point in the history
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
  • Loading branch information
ArnyminerZ committed Jul 5, 2024
1 parent ff9f8ed commit 20a24d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/src/androidTest/java/at/bitfire/vcard4android/IOUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package at.bitfire.vcard4android

object IOUtils {
fun resourceToByteArray(resource: String): ByteArray =
this::class.java.getResourceAsStream(resource)!!.use { it.readBytes() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.GrantPermissionRule
import at.bitfire.vcard4android.AndroidContact
import at.bitfire.vcard4android.Contact
import at.bitfire.vcard4android.IOUtils
import at.bitfire.vcard4android.impl.TestAddressBook
import org.apache.commons.io.IOUtils
import org.junit.Assert.*
import org.junit.BeforeClass
import org.junit.ClassRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.GrantPermissionRule
import at.bitfire.vcard4android.AndroidContact
import at.bitfire.vcard4android.Contact
import at.bitfire.vcard4android.IOUtils
import at.bitfire.vcard4android.impl.TestAddressBook
import org.apache.commons.io.IOUtils
import org.junit.Assert
import org.junit.Assert.*
import org.junit.BeforeClass
Expand Down

0 comments on commit 20a24d7

Please sign in to comment.