2013-06-24 07:24:37 +00:00
|
|
|
import unittest
|
|
|
|
from jnius import autoclass
|
|
|
|
|
|
|
|
class StringArgumentForByteArrayTest(unittest.TestCase):
|
|
|
|
|
|
|
|
def test_string_arg_for_byte_array(self):
|
|
|
|
# the ByteBuffer.wrap() accept only byte[].
|
|
|
|
ByteBuffer = autoclass('java.nio.ByteBuffer')
|
|
|
|
self.assertIsNotNone(ByteBuffer.wrap('hello world'))
|
2015-02-06 17:34:50 +00:00
|
|
|
|
|
|
|
def test_string_arg_with_signed_char(self):
|
|
|
|
ByteBuffer = autoclass('java.nio.ByteBuffer')
|
|
|
|
self.assertIsNotNone(ByteBuffer.wrap('\x00\xffHello World\x7f'))
|