login about faq

Hi, Can some one tell me the method to do this. When I use CkByteData's getBytes() or getData() I am getting syntax error as these functions are not returning Java byte array

asked Jul 18 at 11:42

Allen's gravatar image

Allen
1111


Isn't it byte array simply is byte[]? Then use loop (for) and assign each byte to a new byte[] using getBytes().

link

answered Jul 19 at 09:11

gencer's gravatar image

gencer
162

I'm sorry for the difficulty.

Here's the correct solution:

CkByteData byteData = new CkByteData();

// Create a Java byte array with some bytes..
byte[] myData = "Any String you want".getBytes();

// Copy the bytes from the Java byte array into the CkByteData.
byteData.appendByteArray(myData);

// Copy the bytes from the CkByteData to a new Java byte array.
byte[] myData2 = byteData.toByteArray();
link

answered Jul 19 at 11:10

chilkat's gravatar image

chilkat ♦♦
12.8k317367483

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×28
×8

Asked: Jul 18 at 11:42

Seen: 243 times

Last updated: Jul 19 at 11:10

powered by OSQA