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
Post a Comment