public class OpaqueBytes
A simple class that wraps a byte array and makes the equals/hashCode/toString methods work as you actually expect. In an ideal JVM this would be a value type and be completely overhead free. Project Valhalla is adding such functionality to Java, but it won't arrive for a few years yet!
Modifier and Type | Class and Description |
---|---|
static class |
OpaqueBytes.Companion |
Modifier and Type | Field and Description |
---|---|
static OpaqueBytes.Companion |
Companion |
Constructor and Description |
---|
OpaqueBytes(byte[] bytes)
A simple class that wraps a byte array and makes the equals/hashCode/toString methods work as you actually expect.
In an ideal JVM this would be a value type and be completely overhead free. Project Valhalla is adding such
functionality to Java, but it won't arrive for a few years yet!
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
byte[] |
getBytes() |
int |
getSize() |
int |
hashCode() |
java.io.ByteArrayInputStream |
open()
Returns a ByteArrayInputStream of the bytes
|
java.lang.String |
toString() |
public static OpaqueBytes.Companion Companion
public OpaqueBytes(byte[] bytes)
A simple class that wraps a byte array and makes the equals/hashCode/toString methods work as you actually expect. In an ideal JVM this would be a value type and be completely overhead free. Project Valhalla is adding such functionality to Java, but it won't arrive for a few years yet!
public boolean equals(java.lang.Object other)
public int hashCode()
public java.lang.String toString()
public int getSize()
public java.io.ByteArrayInputStream open()
Returns a ByteArrayInputStream of the bytes
public byte[] getBytes()