Package org.rococoa.cocoa.foundation

Examples of org.rococoa.cocoa.foundation.NSData$_Class


public class NSDataTest extends RococoaTestCase {

    @Test public void testInitWithBytes() throws Exception {
       byte[] bytes = "Hello".getBytes();
      
       NSData data = NSData.CLASS.dataWithBytes_length(bytes, bytes.length);
       assertEquals(bytes.length, data.length());

       byte[] resultBytes = new byte[bytes.length];
       data.getBytes(resultBytes);
       assertEquals("Hello", new String(resultBytes));
   }
View Full Code Here

TOP

Related Classes of org.rococoa.cocoa.foundation.NSData$_Class

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.