Class BinaryValue
java.lang.Object
com.github.robtimus.os.windows.registry.RegistryValue
com.github.robtimus.os.windows.registry.SettableRegistryValue
com.github.robtimus.os.windows.registry.BinaryValue
A representation of binary registry values.
Instances of this class are immutable.
- Author:
- Rob Spoor
-
Nested Class Summary
Nested classes/interfaces inherited from class RegistryValue
RegistryValue.Filter -
Field Summary
Fields inherited from class RegistryValue
DEFAULT -
Method Summary
Modifier and TypeMethodDescriptionbyte[]data()Returns the registry value's binary data.booleaninthashCode()Returns an input stream over the registry value's binary data.static BinaryValueCreates a new binary registry value.static BinaryValueof(String name, InputStream data) Creates a new binary registry value.toString()withData(byte[] data) Returns a registry value with the same name as this registry value but different binary data.withData(InputStream data) Returns a registry value with the same name as this registry value but different binary data.Returns a registry value with the same value as this registry value but a different name.Methods inherited from class RegistryValue
filter, name
-
Method Details
-
of
Creates a new binary registry value.- Parameters:
name- The name of the registry value.data- The registry value's binary data.- Returns:
- The created binary registry value.
- Throws:
NullPointerException- If the given name or byte array isnull.
-
of
Creates a new binary registry value.- Parameters:
name- The name of the registry value.data- An input stream with the registry value's binary data.- Returns:
- The created binary registry value.
- Throws:
NullPointerException- If the given name or input stream isnull.IOException- If an I/O error occurs while reading from the given input stream.
-
data
public byte[] data()Returns the registry value's binary data.- Returns:
- A copy of the registry value's binary data.
-
inputStream
Returns an input stream over the registry value's binary data.- Returns:
- An input stream over the registry value's binary data.
-
withName
Description copied from class:SettableRegistryValueReturns a registry value with the same value as this registry value but a different name.- Specified by:
withNamein classSettableRegistryValue- Parameters:
name- The name of the registry value to return.- Returns:
- A registry value with the same value as this registry value and the given name.
-
withData
Returns a registry value with the same name as this registry value but different binary data.- Parameters:
data- The binary data of the registry value to return.- Returns:
- A registry value with the same name as this registry value and the given binary data.
- Throws:
NullPointerException- If the given array isnull.
-
withData
Returns a registry value with the same name as this registry value but different binary data.- Parameters:
data- An input stream with the binary data of the registry value to return.- Returns:
- A registry value with the same name as this registry value and the binary data from the given input stream.
- Throws:
IOException- If an I/O error occurs while reading from the given input stream.
-
equals
- Overrides:
equalsin classRegistryValue
-
hashCode
public int hashCode()- Overrides:
hashCodein classRegistryValue
-
toString
-