Java String to Byte Array getBytes(String str)

Here you can find the source of getBytes(String str)

Description

get Bytes

License

Open Source License

Declaration

private static byte[] getBytes(String str) throws UnsupportedEncodingException 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;

public class Main {
    private static final String CHARSET = "UTF-8";

    private static byte[] getBytes(String str) throws UnsupportedEncodingException {
        return str.getBytes(CHARSET);
    }//from   w  w w .j ava  2 s .c  om
}

Related

  1. getBytes(String s, String encoding)
  2. getBytes(String str)
  3. getBytes(String str)
  4. getBytes(String str)
  5. getBytes(String str)
  6. getBytes(String str)
  7. getBytes(String str)
  8. getBytes(String str, String charset)
  9. getBytes(String string, String charsetName)