java - Converting all args to a bytes array -


hello guys i'm new java , i've been toying it, right i'm trying convert entry's in "args" (arguments) byte array can have raw bytes at... right i'm trying this:

int bytepointer=0; int argspointer=0;    byte[] ourmessage = new byte[80];  while(args.length>=argspointer) {     ourmessage[bytepointer] = args[argspointer].getbytes();     argspointer++;      bytepointer = bytepointer + args[argspointer].length();     bytepointer++; } 

within loop javas giving error "byte[] cannot converted byte". can't seem find method however, searches have led me else?

you need fill ourmessage array array args[argspointer].getbytes() 1 @ time:

while(args.length>=argspointer) {     byte[] argbytes = args[argspointer].getbytes();     for(int = 0; < argbytes.length; i++, bytepointer++) {         ourmessage[bytepointer] = argbytes[i];     }     argspointer++; } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -