#include "mm/memory.h"
#include "native/jni.h"
+#include "native/llni.h"
#include "native/native.h"
#include "native/include/com_sun_cldc_io_j2me_socket_Protocol.h"
* Method: open0
* Signature: ([BII)I
*/
-JNIEXPORT s4 JNICALL Java_com_sun_cldc_io_j2me_socket_Protocol_open0(JNIEnv *env, jclass clazz, java_bytearray *hostname, s4 port, s4 mode)
+JNIEXPORT s4 JNICALL Java_com_sun_cldc_io_j2me_socket_Protocol_open0(JNIEnv *env, jclass clazz, java_handle_bytearray_t *hostname, s4 port, s4 mode)
{
struct hostent *phostent;
struct sockaddr_in serv_addr;
/* The hostname byte-array is a NULL terminated C-string. */
- name = (char *) &(hostname->data);
+ name = (char *) &(LLNI_array_data(hostname));
/* get the host */
* Method: readBuf
* Signature: (I[BII)I
*/
-JNIEXPORT s4 JNICALL Java_com_sun_cldc_io_j2me_socket_Protocol_readBuf(JNIEnv *env, jclass clazz, s4 handle, java_bytearray *b, s4 off, s4 len)
+JNIEXPORT s4 JNICALL Java_com_sun_cldc_io_j2me_socket_Protocol_readBuf(JNIEnv *env, jclass clazz, s4 handle, java_handle_bytearray_t *b, s4 off, s4 len)
{
void *buf;
ssize_t result;
/* get pointer to the buffer */
- buf = &(b->data[off]);
+ buf = &(LLNI_array_direct(b, off));
/* receive from the socket */
* Method: writeBuf
* Signature: (I[BII)I
*/
-JNIEXPORT s4 JNICALL Java_com_sun_cldc_io_j2me_socket_Protocol_writeBuf(JNIEnv *env, jclass clazz, s4 handle, java_bytearray* b, s4 off, s4 len) {
+JNIEXPORT s4 JNICALL Java_com_sun_cldc_io_j2me_socket_Protocol_writeBuf(JNIEnv *env, jclass clazz, s4 handle, java_handle_bytearray_t * b, s4 off, s4 len) {
void *buf;
ssize_t result;
/* get pointer to the buffer */
- buf = &(b->data[off]);
+ buf = &(LLNI_array_direct(b, off));
/* send the given byte to the socket */