• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How can I send a char array over the Obj-C/Java bridge as a byte array?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I send a char array over the Obj-C/Java bridge as a byte array?


  • Subject: How can I send a char array over the Obj-C/Java bridge as a byte array?
  • From: Yojimbo <email@hidden>
  • Date: Mon, 28 Jul 2003 14:50:33 -0700

Hi all,

We've got a situation where we have a non-nil terminated character array and need to send it across the Obj-C/Java bridge to a Java method requiring a byte array. Right now, to get around type conversions etc., I'm currently having to write the data we receive to a file and read it back in as an NSString so that I can pass it on to a Java wrapper that accepts the String and gets the bytes from it using getBytes(). This solution obviously is just a workaround and we can't be 100% sure that we aren't losing data in the conversion to NSString since the data has several nils in it and is not nil terminated.

My knowledge on the Java bridge is limited and I've found virtually no documentation that helps me in this situation. I was wondering if anyone on this list might happen to know how I can pass this data across the Obj-C/Java bridge unaltered from an Obj-C method or could point me in the right direction to look for solutions?

Any help would be greatly appreciated.

Thanks,
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How can I send a char array over the Obj-C/Java bridge as a byte array?
      • From: Dave Thorup <email@hidden>
  • Prev by Date: Debug problem
  • Next by Date: Re: Memory Management
  • Previous by thread: Debug problem
  • Next by thread: Re: How can I send a char array over the Obj-C/Java bridge as a byte array?
  • Index(es):
    • Date
    • Thread