public class VectorReader extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
VectorReader.Factory<T>
Interface for test vector factories.
|
Modifier and Type | Field and Description |
---|---|
static Pattern |
COMMENT_PATTERN
Pattern for comments.
|
static Pattern |
RESULT_PATTERN
Pattern for results.
|
Constructor and Description |
---|
VectorReader() |
Modifier and Type | Method and Description |
---|---|
static BigInteger |
asBigInteger(String value)
Converts value to a
BigInteger . |
static boolean |
asBoolean(String value)
Converts pass/fail value to a boolean
|
static byte[] |
asBytes(String value)
Converts value to a byte array.
|
static byte[] |
asBytes(String value,
boolean strip)
Converts value to a byte array.
|
static <T> Collection<T> |
getTestVectors(String fileName,
boolean withHash,
Pattern ignoredLine,
Map<String,Pattern> patternMap,
boolean allowNulls,
VectorReader.Factory<T> factory)
Read test vectors from a file.
|
static <T> Collection<T> |
getTestVectors(String fileName,
boolean withHash,
Pattern ignoredLine,
Map<String,Pattern> patternMap,
VectorReader.Factory<T> factory)
Read test vectors from a file.
|
public static final Pattern COMMENT_PATTERN
public static final Pattern RESULT_PATTERN
public static BigInteger asBigInteger(String value)
BigInteger
.value
- BigInteger
public static byte[] asBytes(String value)
value
- public static byte[] asBytes(String value, boolean strip)
value
- strip
- whether to strip leading zerospublic static boolean asBoolean(String value)
value
- public static <T> Collection<T> getTestVectors(String fileName, boolean withHash, Pattern ignoredLine, Map<String,Pattern> patternMap, VectorReader.Factory<T> factory) throws IOException
fileName
- file containing the test vectorswithHash
- whether the test uses a hashignoredLine
- regular expression for ignored lines like commentspatternMap
- mapping values to patternsfactory
- test vector factoryIOException
public static <T> Collection<T> getTestVectors(String fileName, boolean withHash, Pattern ignoredLine, Map<String,Pattern> patternMap, boolean allowNulls, VectorReader.Factory<T> factory) throws IOException
fileName
- file containing the test vectorswithHash
- whether the test uses a hashignoredLine
- regular expression for ignored lines like commentspatternMap
- mapping values to patternsallowNulls
- whether to allow unset valuesfactory
- test vector factoryIOException
Copyright © 2011–2022 Stiftung SIC. All rights reserved.