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
-
public final class BinaryValue extends SettableRegistryValue
A representation of binary registry values. Instances of this class are immutable.- Author:
- Rob Spoor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.robtimus.os.windows.registry.RegistryValue
RegistryValue.Filter
-
-
Field Summary
-
Fields inherited from class com.github.robtimus.os.windows.registry.RegistryValue
DEFAULT
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]data()Returns the registry value's binary data.booleanequals(Object o)inthashCode()InputStreaminputStream()Returns an input stream over the registry value's binary data.static BinaryValueof(String name, byte[] data)Creates a new binary registry value.static BinaryValueof(String name, InputStream data)Creates a new binary registry value.StringtoString()BinaryValuewithData(byte[] data)Returns a registry value with the same name as this registry value but different binary data.BinaryValuewithData(InputStream data)Returns a registry value with the same name as this registry value but different binary data.BinaryValuewithName(String name)Returns a registry value with the same value as this registry value but a different name.-
Methods inherited from class com.github.robtimus.os.windows.registry.RegistryValue
filter, name
-
-
-
-
Method Detail
-
of
public static BinaryValue of(String name, byte[] data)
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
public static BinaryValue of(String name, InputStream data) throws IOException
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
public InputStream inputStream()
Returns an input stream over the registry value's binary data.- Returns:
- An input stream over the registry value's binary data.
-
withName
public BinaryValue withName(String name)
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
public BinaryValue withData(byte[] data)
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
public BinaryValue withData(InputStream data) throws IOException
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
public boolean equals(Object o)
- Overrides:
equalsin classRegistryValue
-
hashCode
public int hashCode()
- Overrides:
hashCodein classRegistryValue
-
-