Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

convert string to byte java

  String example = "Convert Java String";
  byte[] bytes = example.getBytes();
Comment

String to Byte array Java

import java.util.Arrays;

public class StringToByte {
 public static void main(String[] args) {
  String str = "Example String";
  byte[] b = str.getBytes();
  System.out.println("Array " + b);
  System.out.println("Array as String" + Arrays.toString(b));
 }
}
Comment

java string from byte array

 String s = new String(bytes, StandardCharsets.UTF_8);
Comment

PREVIOUS NEXT
Code Example
Java :: How to iterate hashmap entries in java 
Java :: char to int 
Java :: error cannot find symbol intent 
Java :: java stream limit items 
Java :: java convert to roman numerals 
Java :: java to check if its a number scanner 
Java :: how to generate random id in java 
Java :: android list[index] 
Java :: java how to make a number 
Java :: how to convert string array to int in java 
Java :: how to iterate pixels image java 
Java :: overloading + operator in java 
Java :: calendar.year java 
Java :: string to char in java 
Java :: reentrantlock java 
Java :: running sum of 1d array 
Java :: get random number from enum in java 
Java :: timestamp java jpa 
Java :: generatedvalue spring boot 
Java :: imageview height based on screen size 
Java :: Duration class java 
Java :: last char in string java 
Java :: arrays.aslist 
Java :: sudoku solver 
Java :: array input java 
Java :: change string to char array 
Java :: initialize applet in java 
Java :: send action bar message bukkit 
Java :: random number generator java with range 
Java :: how to print in a new line in java using print 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =