public class SecureCharArray extends Object implements CharSequence
| Constructor and Description |
|---|
SecureCharArray() |
SecureCharArray(byte[] bytes) |
SecureCharArray(char[] chars) |
SecureCharArray(int size) |
SecureCharArray(SecureCharArray copy) |
SecureCharArray(String str)
Creates the object from a string (don't pass passwords in this way).
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(SecureCharArray arr)
Appends another SecureCharArray to this one.
|
char |
charAt(int index) |
void |
erase()
Erases the data in this array by writing a pattern over every element
of the array.
|
char |
getCharAt(int index)
Obtains the character at an index.
|
char[] |
getData()
Returns a reference to the data.
|
int |
length() |
void |
prepend(SecureCharArray arr)
Prepends this array with another SecureCharArray.
|
void |
replace(SecureCharArray arr)
Replaces the contents of this array with a copy of those in arr, resizing
the array as needed.
|
void |
resize(int size,
boolean retainData)
Resizes the array, optionally keeping the old data.
|
void |
setCharAt(int index,
char c)
Sets the character at an index.
|
int |
size()
Gets the size of this array.
|
CharSequence |
subSequence(int start,
int end) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringpublic SecureCharArray()
public SecureCharArray(int size)
public SecureCharArray(byte[] bytes)
public SecureCharArray(char[] chars)
public SecureCharArray(SecureCharArray copy)
public SecureCharArray(String str)
str - The string object to get the data from.public void append(SecureCharArray arr) throws Exception
arr - The array to append.Exception - Upon size problems. (lol)public void erase()
public char getCharAt(int index)
throws ArrayIndexOutOfBoundsException
index - The index to obtain the character at.ArrayIndexOutOfBoundsException - Upon bad index.public char[] getData()
public void prepend(SecureCharArray arr) throws Exception
arr - The array to prepend.Exception - Upon size problems. (lol)public void replace(SecureCharArray arr) throws Exception
arr - The copy to use.Exceptionpublic void resize(int size,
boolean retainData)
throws Exception
size - The new size of the array. This must be 1 or larger.retainData - Whether or not to keep the old data.Exception - If the size is 0 or less.public void setCharAt(int index,
char c)
throws ArrayIndexOutOfBoundsException
index - The index to set at.c - The character to set.ArrayIndexOutOfBoundsException - Upon bad index.public int size()
public char charAt(int index)
charAt in interface CharSequencepublic int length()
length in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequenceArrayIndexOutOfBoundsException - - if from < 0 or from > original.length()IllegalArgumentException - - if from > toCharSequence#subSequence(int, int)}Copyright © 2014. All rights reserved.