Java Sting to byte array

String example = "This is an exa"
byte[] bytes = example.getBytes();
public String openFileToString(byte[] _bytes)
{
    String file_string = "";

    for(int i = 0; i < _bytes.length; i++)
    {
        file_string += (char)_bytes[i];
    }

    return file_string;    
}

댓글 남기기