From 023b0901731c61d9beab042df564b7f89697ecff Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Fri, 29 Nov 2013 11:17:09 +0100 Subject: Fixed Multithreading Bug Coding Helper --- .../main/java/at/knowcenter/wag/egov/egiz/tools/CodingHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pdf-as-lib') diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/tools/CodingHelper.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/tools/CodingHelper.java index 3546cd7..eebe127 100644 --- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/tools/CodingHelper.java +++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/tools/CodingHelper.java @@ -47,7 +47,7 @@ public class CodingHelper /** * Static Base64 object */ - private static Base64 b64 = new Base64(); + //private static Base64 b64 = new Base64(); /** * This method encodes a given Unicode (Java) String to UTF-8 bytes and then @@ -61,6 +61,7 @@ public class CodingHelper { try { + Base64 b64 = new Base64(); byte[] utf8_bytes = plain_string.getBytes("UTF-8"); byte[] base64_bytes = b64.encode(utf8_bytes); String encoded_string = new String(base64_bytes, "US-ASCII"); @@ -84,6 +85,7 @@ public class CodingHelper { try { + Base64 b64 = new Base64(); byte[] base64_bytes = encoded_string.getBytes("US-ASCII"); byte[] utf8_bytes = b64.decode(base64_bytes); String plain_string = new String(utf8_bytes, "UTF-8"); @@ -157,6 +159,7 @@ public class CodingHelper { try { + Base64 b64 = new Base64(); byte[] base64_bytes = theString.getBytes("US-ASCII"); return b64.decode(base64_bytes); } @@ -175,6 +178,7 @@ public class CodingHelper */ public static byte[] decodeBase64(byte[] ba) { + Base64 b64 = new Base64(); return b64.decode(ba); } @@ -189,6 +193,7 @@ public class CodingHelper { try { + Base64 b64 = new Base64(); byte[] base64_bytes = b64.encode(plainString); return new String(base64_bytes, "US-ASCII"); } -- cgit v1.2.3