For an application I'm working on, I'm trying to convert a byte array to a
String for storage in a database. I've been trying to use a constructor I found in the String class documentation: String(byte[]bytes, String encoding). My code is compiling and running with no errors, but the resulting String is always empty, even though I've confirmed through debugging code that the byte array definitely has data. I suspect that the problem may be related to the fact that some of the bytes are negative or in some way out-of-range for the encoding, but haven't been able to identify the exact problem. Does anybody know how to make this work?