Package com.palantir.conjure.java.lib
Class Bytes
- java.lang.Object
-
- com.palantir.conjure.java.lib.Bytes
-
public final class Bytes extends java.lang.ObjectAn immutablebyte[]wrapper.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]asNewByteArray()Returns a new byte array containing the same content as this object's underlyingbyte[].java.nio.ByteBufferasReadOnlyByteBuffer()Returns a new read-onlyByteBufferbacked by this byte array.voidcopyTo(byte[] destination, int offset, int length)Copies this byte array into the provided byte array beginning at offset and up to the provided length.booleanequals(java.lang.Object obj)static Bytesfrom(byte[] array)Constructs a newBytesfrom the provided array.static Bytesfrom(byte[] array, int offset, int length)Constructs a newBytesread from provided offset for the provided length.static Bytesfrom(java.nio.ByteBuffer buffer)Constructs a newBytesread from the providedByteBuffer.java.io.InputStreamgetInputStream()Returns a newInputStreamthat reads this byte array.inthashCode()intsize()Returns the size of this byte array.java.lang.StringtoString()
-
-
-
Method Detail
-
asReadOnlyByteBuffer
public java.nio.ByteBuffer asReadOnlyByteBuffer()
Returns a new read-onlyByteBufferbacked by this byte array.
-
asNewByteArray
public byte[] asNewByteArray()
Returns a new byte array containing the same content as this object's underlyingbyte[].
-
copyTo
public void copyTo(byte[] destination, int offset, int length)Copies this byte array into the provided byte array beginning at offset and up to the provided length.
-
getInputStream
public java.io.InputStream getInputStream()
Returns a newInputStreamthat reads this byte array.
-
size
public int size()
Returns the size of this byte array.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
from
public static Bytes from(byte[] array, int offset, int length)
Constructs a newBytesread from provided offset for the provided length.
-
-