public class LongArrayCodec extends AbstractPrimitiveArrayCodec<long[]>
list<long> to the Java type long[].
Note that this codec is designed for performance and converts CQL lists directly to
long[], thus avoiding any unnecessary boxing and unboxing of Java primitive long
values; it also instantiates arrays without the need for an intermediary Java List
object.
TypeCodec.AbstractCollectionCodec<E,C extends Collection<E>>, TypeCodec.AbstractMapCodec<K,V>, TypeCodec.AbstractTupleCodec<T>, TypeCodec.AbstractUDTCodec<T>, TypeCodec.PrimitiveBooleanCodec, TypeCodec.PrimitiveByteCodec, TypeCodec.PrimitiveDoubleCodec, TypeCodec.PrimitiveFloatCodec, TypeCodec.PrimitiveIntCodec, TypeCodec.PrimitiveLongCodec, TypeCodec.PrimitiveShortCodec| Modifier and Type | Field and Description |
|---|---|
static LongArrayCodec |
instance |
| Constructor and Description |
|---|
LongArrayCodec() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
deserializeElement(ByteBuffer input,
long[] array,
int index,
ProtocolVersion protocolVersion)
Read the
indexth element of array from input. |
protected void |
formatElement(StringBuilder output,
long[] array,
int index)
Format the
indexth element of array to output. |
protected long[] |
newInstance(int size)
Create a new array instance with the given size.
|
protected void |
parseElement(String input,
long[] array,
int index)
Parse the
indexth element of array from input. |
protected void |
serializeElement(ByteBuffer output,
long[] array,
int index,
ProtocolVersion protocolVersion)
Write the
indexth element of array to output. |
protected int |
sizeOfComponentType()
Return the size in bytes of the array component type.
|
deserialize, serializeformat, parseaccepts, accepts, accepts, accepts, ascii, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, duration, getCqlType, getJavaType, inet, list, map, set, smallInt, time, timestamp, timeUUID, tinyInt, toString, tuple, userType, uuid, varchar, varintpublic static final LongArrayCodec instance
protected int sizeOfComponentType()
AbstractPrimitiveArrayCodecsizeOfComponentType in class AbstractPrimitiveArrayCodec<long[]>protected void serializeElement(ByteBuffer output, long[] array, int index, ProtocolVersion protocolVersion)
AbstractPrimitiveArrayCodecindexth element of array to output.serializeElement in class AbstractPrimitiveArrayCodec<long[]>output - The ByteBuffer to write to.array - The array to read from.index - The element index.protocolVersion - The protocol version to use.protected void deserializeElement(ByteBuffer input, long[] array, int index, ProtocolVersion protocolVersion)
AbstractPrimitiveArrayCodecindexth element of array from input.deserializeElement in class AbstractPrimitiveArrayCodec<long[]>input - The ByteBuffer to read from.array - The array to write to.index - The element index.protocolVersion - The protocol version to use.protected void formatElement(StringBuilder output, long[] array, int index)
AbstractArrayCodecindexth element of array to output.formatElement in class AbstractArrayCodec<long[]>output - The StringBuilder to write to.array - The array to read from.index - The element index.protected void parseElement(String input, long[] array, int index)
AbstractArrayCodecindexth element of array from input.parseElement in class AbstractArrayCodec<long[]>input - The String to read from.array - The array to write to.index - The element index.protected long[] newInstance(int size)
AbstractArrayCodecnewInstance in class AbstractArrayCodec<long[]>size - The size of the array to instantiate.Copyright © 2012–2023. All rights reserved.