I have a C-style string encoded as an array of characters in Java, but I would like to convert this array to a Java String. I tried using the matching constructor call,

```
String toRet = new String(new char[]{'B','A','D','\0', 'G', 'A', 'R', 'B', 'A', 'G', 'E'});
System.out.println(Arrays.toString(toRet.toCharArray()));

```

But the result is incorrect, and in fact oddly buggy. Here's what the above code outputs:

```
[B, A, D,

```

And here's what I want 

```
[B, A, D]

```

I'm running on openJdk6 on Ubuntu. I haven't tested the above code on other VM's.