KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > jcetaglib > lib > Clean


1 /*
2   Name: Clean.java
3   Licensing: LGPL
4
5   API: Sun (http://java.sun.com) JCE 1.2.2 API (cleanroom implementation by Bouncy Castle)
6   Provider: Bouncy Castle (http://www.bouncycastle.org)
7
8   Disclaimer:
9
10   COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND,
11   EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE
12   IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
13   RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE
14   PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR)
15   ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
16   CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED
17   HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
18
19   (C) Copyright 2003 Gert Van Ham
20 */

21
22 package net.sourceforge.jcetaglib.lib;
23
24 /**
25  * Clean byte arrays & string buffers
26  *
27  * @author Gert Van Ham
28  * @author hamgert@users.sourceforge.net
29  * @author http://jcetaglib.sourceforge.net
30  * @version $Id: Clean.java,v 1.3 2004/04/15 07:28:25 hamgert Exp $
31  */

32 public class Clean {
33     /**
34      * zero out the passed in byte array
35      *
36      * @param bytes byte[] common byte array
37      **/

38     static public void blank(byte[] bytes) {
39         for (int t = 0; t < bytes.length; t++) {
40             bytes[t] = 0;
41         }
42     }
43
44     /**
45      * zero out the passed in StringBuffer
46      *
47      * @param stringbuffer StringBuffer[]
48      **/

49     static public void blank(StringBuffer JavaDoc stringbuffer) {
50         if (stringbuffer != null) {
51             stringbuffer.delete(0, stringbuffer.length());
52         }
53     }
54 }
55
Popular Tags