Class CannedFuzzedDataProvider
- All Implemented Interfaces:
FuzzedDataProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconsumeAsciiString
(int maxLength) Consumes an ASCII-onlyString
from the fuzzer input.boolean
Consumes aboolean
from the fuzzer input.boolean[]
consumeBooleans
(int maxLength) Consumes aboolean
array from the fuzzer input.byte
Consumes abyte
from the fuzzer input.byte
consumeByte
(byte min, byte max) Consumes abyte
betweenmin
andmax
from the fuzzer input.byte[]
consumeBytes
(int maxLength) Consumes abyte
array from the fuzzer input.char
Consumes achar
from the fuzzer input.char
consumeChar
(char min, char max) Consumes achar
betweenmin
andmax
from the fuzzer input.char
Consumes achar
from the fuzzer input that is never a UTF-16 surrogate character.double
Consumes adouble
from the fuzzer input.float
Consumes afloat
from the fuzzer input.int
Consumes anint
from the fuzzer input.int
consumeInt
(int min, int max) Consumes anint
betweenmin
andmax
from the fuzzer input.int[]
consumeInts
(int maxLength) Consumes anint
array from the fuzzer input.long
Consumes along
from the fuzzer input.long
consumeLong
(long min, long max) Consumes along
betweenmin
andmax
from the fuzzer input.long[]
consumeLongs
(int maxLength) Consumes along
array from the fuzzer input.double
Consumes adouble
between 0.0 and 1.0 (inclusive) from the fuzzer input.float
Consumes afloat
between 0.0 and 1.0 (inclusive) from the fuzzer input.double
Consumes a regulardouble
from the fuzzer input.double
consumeRegularDouble
(double min, double max) Consumes a regulardouble
betweenmin
andmax
from the fuzzer input.float
Consumes a regularfloat
from the fuzzer input.float
consumeRegularFloat
(float min, float max) Consumes a regularfloat
betweenmin
andmax
from the fuzzer input.Consumes the remaining fuzzer input as an ASCII-onlyString
.byte[]
Consumes the remaining fuzzer input as abyte
array.Consumes the remaining fuzzer input as aString
.short
Consumes ashort
from the fuzzer input.short
consumeShort
(short min, short max) Consumes ashort
betweenmin
andmax
from the fuzzer input.short[]
consumeShorts
(int maxLength) Consumes ashort
array from the fuzzer input.consumeString
(int maxLength) Consumes aString
from the fuzzer input.static CannedFuzzedDataProvider
int
Returns the number of unconsumed bytes in the fuzzer input.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.code_intelligence.jazzer.api.FuzzedDataProvider
pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValues, pickValues
-
Constructor Details
-
CannedFuzzedDataProvider
-
-
Method Details
-
create
-
consumeBoolean
public boolean consumeBoolean()Description copied from interface:FuzzedDataProvider
Consumes aboolean
from the fuzzer input.- Specified by:
consumeBoolean
in interfaceFuzzedDataProvider
- Returns:
- a
boolean
-
consumeBooleans
public boolean[] consumeBooleans(int maxLength) Description copied from interface:FuzzedDataProvider
Consumes aboolean
array from the fuzzer input.The array will usually have length
length
, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeBooleans
in interfaceFuzzedDataProvider
- Parameters:
maxLength
- the maximum length of the array- Returns:
- a
boolean
array of length at mostlength
-
consumeByte
public byte consumeByte()Description copied from interface:FuzzedDataProvider
Consumes abyte
from the fuzzer input.- Specified by:
consumeByte
in interfaceFuzzedDataProvider
- Returns:
- a
byte
-
consumeByte
public byte consumeByte(byte min, byte max) Description copied from interface:FuzzedDataProvider
Consumes abyte
betweenmin
andmax
from the fuzzer input.- Specified by:
consumeByte
in interfaceFuzzedDataProvider
- Parameters:
min
- the inclusive lower bound on the returned valuemax
- the inclusive upper bound on the returned value- Returns:
- a
byte
in the range[min, max]
-
consumeShort
public short consumeShort()Description copied from interface:FuzzedDataProvider
Consumes ashort
from the fuzzer input.- Specified by:
consumeShort
in interfaceFuzzedDataProvider
- Returns:
- a
short
-
consumeShort
public short consumeShort(short min, short max) Description copied from interface:FuzzedDataProvider
Consumes ashort
betweenmin
andmax
from the fuzzer input.- Specified by:
consumeShort
in interfaceFuzzedDataProvider
- Parameters:
min
- the inclusive lower bound on the returned valuemax
- the inclusive upper bound on the returned value- Returns:
- a
short
in the range[min, max]
-
consumeShorts
public short[] consumeShorts(int maxLength) Description copied from interface:FuzzedDataProvider
Consumes ashort
array from the fuzzer input.The array will usually have length
length
, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeShorts
in interfaceFuzzedDataProvider
- Parameters:
maxLength
- the maximum length of the array- Returns:
- a
short
array of length at mostlength
-
consumeInt
public int consumeInt()Description copied from interface:FuzzedDataProvider
Consumes anint
from the fuzzer input.- Specified by:
consumeInt
in interfaceFuzzedDataProvider
- Returns:
- an
int
-
consumeInt
public int consumeInt(int min, int max) Description copied from interface:FuzzedDataProvider
Consumes anint
betweenmin
andmax
from the fuzzer input.- Specified by:
consumeInt
in interfaceFuzzedDataProvider
- Parameters:
min
- the inclusive lower bound on the returned valuemax
- the inclusive upper bound on the returned value- Returns:
- an
int
in the range[min, max]
-
consumeInts
public int[] consumeInts(int maxLength) Description copied from interface:FuzzedDataProvider
Consumes anint
array from the fuzzer input.The array will usually have length
length
, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeInts
in interfaceFuzzedDataProvider
- Parameters:
maxLength
- the maximum length of the array- Returns:
- an
int
array of length at mostlength
-
consumeLong
public long consumeLong()Description copied from interface:FuzzedDataProvider
Consumes along
from the fuzzer input.- Specified by:
consumeLong
in interfaceFuzzedDataProvider
- Returns:
- a
long
-
consumeLong
public long consumeLong(long min, long max) Description copied from interface:FuzzedDataProvider
Consumes along
betweenmin
andmax
from the fuzzer input.- Specified by:
consumeLong
in interfaceFuzzedDataProvider
- Parameters:
min
- the inclusive lower bound on the returned valuemax
- the inclusive upper bound on the returned value- Returns:
- a
long
in the range @{code [min, max]}
-
consumeLongs
public long[] consumeLongs(int maxLength) Description copied from interface:FuzzedDataProvider
Consumes along
array from the fuzzer input.The array will usually have length
length
, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeLongs
in interfaceFuzzedDataProvider
- Parameters:
maxLength
- the maximum length of the array- Returns:
- a
long
array of length at mostlength
-
consumeFloat
public float consumeFloat()Description copied from interface:FuzzedDataProvider
Consumes afloat
from the fuzzer input.- Specified by:
consumeFloat
in interfaceFuzzedDataProvider
- Returns:
- a
float
that may have a special value (e.g. a NaN or infinity)
-
consumeRegularFloat
public float consumeRegularFloat()Description copied from interface:FuzzedDataProvider
Consumes a regularfloat
from the fuzzer input.- Specified by:
consumeRegularFloat
in interfaceFuzzedDataProvider
- Returns:
- a
float
that is not a special value (e.g. not a NaN or infinity)
-
consumeRegularFloat
public float consumeRegularFloat(float min, float max) Description copied from interface:FuzzedDataProvider
Consumes a regularfloat
betweenmin
andmax
from the fuzzer input.- Specified by:
consumeRegularFloat
in interfaceFuzzedDataProvider
- Returns:
- a
float
in the range[min, max]
-
consumeProbabilityFloat
public float consumeProbabilityFloat()Description copied from interface:FuzzedDataProvider
Consumes afloat
between 0.0 and 1.0 (inclusive) from the fuzzer input.- Specified by:
consumeProbabilityFloat
in interfaceFuzzedDataProvider
- Returns:
- a
float
in the range[0.0, 1.0]
-
consumeDouble
public double consumeDouble()Description copied from interface:FuzzedDataProvider
Consumes adouble
from the fuzzer input.- Specified by:
consumeDouble
in interfaceFuzzedDataProvider
- Returns:
- a
double
that may have a special value (e.g. a NaN or infinity)
-
consumeRegularDouble
public double consumeRegularDouble(double min, double max) Description copied from interface:FuzzedDataProvider
Consumes a regulardouble
betweenmin
andmax
from the fuzzer input.- Specified by:
consumeRegularDouble
in interfaceFuzzedDataProvider
- Returns:
- a
double
in the range[min, max]
-
consumeRegularDouble
public double consumeRegularDouble()Description copied from interface:FuzzedDataProvider
Consumes a regulardouble
from the fuzzer input.- Specified by:
consumeRegularDouble
in interfaceFuzzedDataProvider
- Returns:
- a
double
that is not a special value (e.g. not a NaN or infinity)
-
consumeProbabilityDouble
public double consumeProbabilityDouble()Description copied from interface:FuzzedDataProvider
Consumes adouble
between 0.0 and 1.0 (inclusive) from the fuzzer input.- Specified by:
consumeProbabilityDouble
in interfaceFuzzedDataProvider
- Returns:
- a
double
in the range[0.0, 1.0]
-
consumeChar
public char consumeChar()Description copied from interface:FuzzedDataProvider
Consumes achar
from the fuzzer input.- Specified by:
consumeChar
in interfaceFuzzedDataProvider
-
consumeChar
public char consumeChar(char min, char max) Description copied from interface:FuzzedDataProvider
Consumes achar
betweenmin
andmax
from the fuzzer input.- Specified by:
consumeChar
in interfaceFuzzedDataProvider
- Parameters:
min
- the inclusive lower bound on the returned valuemax
- the inclusive upper bound on the returned value- Returns:
- a
char
in the range[min, max]
-
consumeCharNoSurrogates
public char consumeCharNoSurrogates()Description copied from interface:FuzzedDataProvider
Consumes achar
from the fuzzer input that is never a UTF-16 surrogate character.- Specified by:
consumeCharNoSurrogates
in interfaceFuzzedDataProvider
-
consumeAsciiString
Description copied from interface:FuzzedDataProvider
Consumes an ASCII-onlyString
from the fuzzer input.The returned string may be of any length between 0 and
maxLength
, even if there is more fuzzer input available.- Specified by:
consumeAsciiString
in interfaceFuzzedDataProvider
- Parameters:
maxLength
- the maximum length of the string- Returns:
- a
String
of length between 0 andmaxLength
(inclusive) that contains only ASCII characters
-
consumeString
Description copied from interface:FuzzedDataProvider
Consumes aString
from the fuzzer input.The returned string may be of any length between 0 and
maxLength
, even if there is more fuzzer input available.- Specified by:
consumeString
in interfaceFuzzedDataProvider
- Parameters:
maxLength
- the maximum length of the string- Returns:
- a
String
of length between 0 andmaxLength
(inclusive)
-
consumeRemainingAsAsciiString
Description copied from interface:FuzzedDataProvider
Consumes the remaining fuzzer input as an ASCII-onlyString
.Note: After calling this method, further calls to methods of this interface will return fixed values only.
- Specified by:
consumeRemainingAsAsciiString
in interfaceFuzzedDataProvider
- Returns:
- a
String
that contains only ASCII characters
-
consumeRemainingAsString
Description copied from interface:FuzzedDataProvider
Consumes the remaining fuzzer input as aString
.Note: After calling this method, further calls to methods of this interface will return fixed values only.
- Specified by:
consumeRemainingAsString
in interfaceFuzzedDataProvider
- Returns:
- a
String
-
consumeBytes
public byte[] consumeBytes(int maxLength) Description copied from interface:FuzzedDataProvider
Consumes abyte
array from the fuzzer input.The array will usually have length
length
, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeBytes
in interfaceFuzzedDataProvider
- Parameters:
maxLength
- the maximum length of the array- Returns:
- a
byte
array of length at mostlength
-
consumeRemainingAsBytes
public byte[] consumeRemainingAsBytes()Description copied from interface:FuzzedDataProvider
Consumes the remaining fuzzer input as abyte
array.Note: After calling this method, further calls to methods of this interface will return fixed values only.
- Specified by:
consumeRemainingAsBytes
in interfaceFuzzedDataProvider
- Returns:
- a
byte
array
-
remainingBytes
public int remainingBytes()Description copied from interface:FuzzedDataProvider
Returns the number of unconsumed bytes in the fuzzer input.- Specified by:
remainingBytes
in interfaceFuzzedDataProvider
- Returns:
- the number of unconsumed bytes in the fuzzer input
-