summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2012-10-03 19:50:49 +0000
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2012-10-03 19:50:49 +0000
commit7a6eabd80d2c57cb8018eb4eb98fb46b765ec189 (patch)
tree8c59da2bcdfc542fce56692d9772eb0d7e4f4e8c
parent48aa94dcefe6f94628b548b631ac602dcfceb169 (diff)
downloadmocca-7a6eabd80d2c57cb8018eb4eb98fb46b765ec189.tar.gz
mocca-7a6eabd80d2c57cb8018eb4eb98fb46b765ec189.tar.bz2
mocca-7a6eabd80d2c57cb8018eb4eb98fb46b765ec189.zip
close streams
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1146 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
-rw-r--r--BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java1
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/mocca/id/PersonalIdentifier.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/STALHelper.java2
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java1
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/TransparentFileInputStreamTest.java18
-rw-r--r--utils/src/main/java/at/gv/egiz/dom/DOMUtils.java4
6 files changed, 15 insertions, 13 deletions
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java
index 82b5eb01..b40f3165 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java
@@ -83,6 +83,7 @@ public class SecureViewerDialogTest {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("/home/clemens/IAIK/MOCCA/encoding/test_iso-8859-1.txt"));
byte[] bytes = new byte[bis.available()];
bis.read(bytes);
+ bis.close();
String s = new String(bytes, "iso-8859-1");
System.out.println("read iso-8859-1 bytes " + s);
diff --git a/BKUOnline/src/main/java/at/gv/egiz/mocca/id/PersonalIdentifier.java b/BKUOnline/src/main/java/at/gv/egiz/mocca/id/PersonalIdentifier.java
index 15f3084d..578d72ef 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/mocca/id/PersonalIdentifier.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/mocca/id/PersonalIdentifier.java
@@ -71,7 +71,7 @@ public class PersonalIdentifier {
ByteArrayOutputStream os = new ByteArrayOutputStream();
Base64OutputStream bos = new Base64OutputStream(os);
bos.write(md.digest((value + '+' + domainId).getBytes("ISO-8859-1")));
- bos.flush();
+ bos.close();
return new PersonalIdentifier(domainId, os.toString("ASCII"));
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/STALHelper.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/STALHelper.java
index 13d29c4e..1b4cd565 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/STALHelper.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/STALHelper.java
@@ -194,7 +194,7 @@ public class STALHelper {
writer.flush();
Base64OutputStream b64os = new Base64OutputStream(certDump);
b64os.write(cert);
- b64os.flush();
+ b64os.close();
writer.write("\n-----END CERTIFICATE-----");
writer.flush();
} catch (IOException e1) {
diff --git a/smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java b/smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java
index 4a357cec..ec1fba2c 100644
--- a/smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java
+++ b/smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java
@@ -447,6 +447,7 @@ public class ESCardTest extends AbstractSignatureCard {
}
if (offset < bytes.length) {
+ is.close();
throw new IOException("Could not completely read file "
+ file.getName());
}
diff --git a/smcc/src/test/java/at/gv/egiz/smcc/TransparentFileInputStreamTest.java b/smcc/src/test/java/at/gv/egiz/smcc/TransparentFileInputStreamTest.java
index 69bc69db..6964f2d2 100644
--- a/smcc/src/test/java/at/gv/egiz/smcc/TransparentFileInputStreamTest.java
+++ b/smcc/src/test/java/at/gv/egiz/smcc/TransparentFileInputStreamTest.java
@@ -83,7 +83,7 @@ public class TransparentFileInputStreamTest {
assertEquals(0xFF & i++, b);
}
assertEquals(file.length, i);
-
+ is.close();
}
@Test
@@ -99,7 +99,7 @@ public class TransparentFileInputStreamTest {
}
}
assertEquals(file.length, i);
-
+ is.close();
}
@Test
@@ -115,7 +115,7 @@ public class TransparentFileInputStreamTest {
}
}
assertEquals(file_bs.length, i);
-
+ is.close();
}
@Test(expected = IOException.class)
@@ -124,7 +124,7 @@ public class TransparentFileInputStreamTest {
TransparentFileInputStream is = new TestTransparentFileInputStream(file);
is.read(new byte[128]);
is.reset();
-
+ is.close();
}
@Test
@@ -141,7 +141,7 @@ public class TransparentFileInputStreamTest {
}
}
assertEquals(file.length, i);
-
+ is.close();
}
@Test
@@ -164,7 +164,7 @@ public class TransparentFileInputStreamTest {
}
}
assertEquals(file.length, i);
-
+ is.close();
}
@@ -181,7 +181,7 @@ public class TransparentFileInputStreamTest {
assertEquals(0xFF & i + j, 0xFF & b[j]);
}
is.reset();
-
+ is.close();
}
@Test
@@ -196,7 +196,7 @@ public class TransparentFileInputStreamTest {
for (int j = 0; j < l; j++) {
assertEquals(0xFF & i + j, 0xFF & b[j]);
}
-
+ is.close();
}
@Test
public void testSkipBig() throws IOException {
@@ -210,7 +210,7 @@ public class TransparentFileInputStreamTest {
for (int j = 0; j < l; j++) {
assertEquals(0xFF & i + j, 0xFF & b[j]);
}
-
+ is.close();
}
}
diff --git a/utils/src/main/java/at/gv/egiz/dom/DOMUtils.java b/utils/src/main/java/at/gv/egiz/dom/DOMUtils.java
index 347f205c..20f4199f 100644
--- a/utils/src/main/java/at/gv/egiz/dom/DOMUtils.java
+++ b/utils/src/main/java/at/gv/egiz/dom/DOMUtils.java
@@ -101,7 +101,7 @@ public final class DOMUtils {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Base64OutputStream base64OutputStream = new Base64OutputStream(outputStream);
base64OutputStream.write(bytes);
- base64OutputStream.flush();
+ base64OutputStream.close();
return doc.createTextNode(outputStream.toString("ASCII"));
}
@@ -116,7 +116,7 @@ public final class DOMUtils {
base64OutputStream.write(b, 0, l);
}
- base64OutputStream.flush();
+ base64OutputStream.close();
return doc.createTextNode(outputStream.toString("ASCII"));
}