Findbugs all over #2

Mostly char encoding
Use StringWriter rather than OSW->BAOS->String
This commit is contained in:
zzz
2015-07-12 16:06:49 +00:00
parent 914cc120ad
commit 1f9bb046f5
25 changed files with 76 additions and 68 deletions

View File

@ -94,7 +94,7 @@ public class SAMReader {
_log.error("Error reading from SAM", ioe);
}
String line = new String(baos.toByteArray());
String line = DataHelper.getUTF8(baos.toByteArray());
baos.reset();
if (line == null) {

View File

@ -180,7 +180,7 @@ public class SAMStreamSend {
byte dest[] = new byte[1024];
int read = DataHelper.read(fin, dest);
_remoteDestination = new String(dest, 0, read);
_remoteDestination = DataHelper.getUTF8(dest, 0, read);
synchronized (_remotePeers) {
_connectionId = _remotePeers.size() + 1;
_remotePeers.put(Integer.valueOf(_connectionId), Sender.this);