Java com.google.common.primitives Shorts fields, constructors, methods, implement or subclass

Example usage for Java com.google.common.primitives Shorts fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.google.common.primitives Shorts.

The text is from its open source code.

Field

intBYTES
The number of bytes required to represent a primitive short value.

Method

ListasList(short... backingArray)
Returns a fixed-size list backed by the specified array, similar to Arrays#asList(Object[]) .
shortcheckedCast(long value)
Returns the short value that is equal to value , if possible.
intcompare(short a, short b)
Compares the two specified short values.
shortfromByteArray(byte[] bytes)
Returns the short value whose big-endian representation is stored in the first 2 bytes of bytes ; equivalent to ByteBuffer.wrap(bytes).getShort() .
shortfromBytes(byte b1, byte b2)
Returns the short value whose byte representation is the given 2 bytes, in big-endian order; equivalent to Shorts.fromByteArray(new byte[] {b1, b2})}.
inthashCode(short value)
Returns a hash code for value ; equal to the result of invoking ((Short) value).hashCode() .
shortsaturatedCast(long value)
Returns the short nearest in value to value .
short[]toArray(Collection collection)
Returns an array containing each value of collection , converted to a short value in the manner of Number#shortValue .
byte[]toByteArray(short value)
Returns a big-endian representation of value in a 2-element byte array; equivalent to ByteBuffer.allocate(2).putShort(value).array() .