CBUtil (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.transport

## Class CBUtil

- java.lang.Object
- - org.apache.cassandra.transport.CBUtil

-     public abstract class CBUtil
      extends java.lang.Object

  ByteBuf utility methods. Note that contrarily to ByteBufferUtil, these method do "read" the ByteBuf advancing its (read) position. They also write by advancing the write position. Functions are also provided to create ByteBuf while avoiding copies.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.netty.buffer.ByteBufAllocator` | `allocator`
    `static boolean` | `USE_HEAP_ALLOCATOR`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.nio.ByteBuffer` | `readBoundValue(io.netty.buffer.ByteBuf cb, ProtocolVersion protocolVersion)`
    `static byte[]` | `readBytes(io.netty.buffer.ByteBuf cb)`
    `static java.util.Map<java.lang.String,java.nio.ByteBuffer>` | `readBytesMap(io.netty.buffer.ByteBuf cb)`
    `static ConsistencyLevel` | `readConsistencyLevel(io.netty.buffer.ByteBuf cb)`
    `static <T extends java.lang.Enum<T>> T` | `readEnumValue(java.lang.Class<T> enumType, io.netty.buffer.ByteBuf cb)`
    `static java.net.InetSocketAddress` | `readInet(io.netty.buffer.ByteBuf cb)`
    `static java.net.InetAddress` | `readInetAddr(io.netty.buffer.ByteBuf cb)`
    `static java.lang.String` | `readLongString(io.netty.buffer.ByteBuf cb)`
    `static Pair<java.util.List<java.lang.String>,java.util.List<java.nio.ByteBuffer>>` | `readNameAndValueList(io.netty.buffer.ByteBuf cb, ProtocolVersion protocolVersion)`
    `static byte[]` | `readRawBytes(io.netty.buffer.ByteBuf cb)`
    `static java.lang.String` | `readString(io.netty.buffer.ByteBuf cb)`
    `static java.util.List<java.lang.String>` | `readStringList(io.netty.buffer.ByteBuf cb)`
    `static java.util.Map<java.lang.String,java.lang.String>` | `readStringMap(io.netty.buffer.ByteBuf cb)`
    `static java.util.Map<java.lang.String,java.util.List<java.lang.String>>` | `readStringToStringListMap(io.netty.buffer.ByteBuf cb)`
    `static java.util.UUID` | `readUUID(io.netty.buffer.ByteBuf cb)`
    `static java.nio.ByteBuffer` | `readValue(io.netty.buffer.ByteBuf cb)`
    `static java.util.List<java.nio.ByteBuffer>` | `readValueList(io.netty.buffer.ByteBuf cb, ProtocolVersion protocolVersion)`
    `static int` | `sizeOfBytes(byte[] bytes)`
    `static int` | `sizeOfBytesMap(java.util.Map<java.lang.String,java.nio.ByteBuffer> m)`
    `static int` | `sizeOfConsistencyLevel(ConsistencyLevel consistency)`
    `static <T extends java.lang.Enum<T>> int` | `sizeOfEnumValue(T enumValue)`
    `static int` | `sizeOfInet(java.net.InetSocketAddress inet)`
    `static int` | `sizeOfInetAddr(java.net.InetAddress inetAddr)`
    `static int` | `sizeOfLongString(java.lang.String str)`
    `static int` | `sizeOfString(java.lang.String str)`
    `static int` | `sizeOfStringList(java.util.List<java.lang.String> l)`
    `static int` | `sizeOfStringMap(java.util.Map<java.lang.String,java.lang.String> m)`
    `static int` | `sizeOfStringToStringListMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> m)`
    `static int` | `sizeOfUUID(java.util.UUID uuid)`
    `static int` | `sizeOfValue(byte[] bytes)`
    `static int` | `sizeOfValue(java.nio.ByteBuffer bytes)`
    `static int` | `sizeOfValue(int valueSize)`
    `static int` | `sizeOfValueList(java.util.List<java.nio.ByteBuffer> values)`
    `static void` | `writeBytes(byte[] bytes, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeBytesMap(java.util.Map<java.lang.String,java.nio.ByteBuffer> m, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeConsistencyLevel(ConsistencyLevel consistency, io.netty.buffer.ByteBuf cb)`
    `static <T extends java.lang.Enum<T>> void` | `writeEnumValue(T enumValue, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeInet(java.net.InetSocketAddress inet, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeInetAddr(java.net.InetAddress inetAddr, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeLongString(java.lang.String str, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeString(java.lang.String str, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeStringList(java.util.List<java.lang.String> l, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeStringMap(java.util.Map<java.lang.String,java.lang.String> m, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeStringToStringListMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> m, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeUUID(java.util.UUID uuid, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeValue(byte[] bytes, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeValue(java.nio.ByteBuffer bytes, io.netty.buffer.ByteBuf cb)`
    `static void` | `writeValueList(java.util.List<java.nio.ByteBuffer> values, io.netty.buffer.ByteBuf cb)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### USE_HEAP_ALLOCATOR

          public static final boolean USE_HEAP_ALLOCATOR

    - #### allocator

          public static final io.netty.buffer.ByteBufAllocator allocator

  - ### Method Detail

    - #### readString

          public static java.lang.String readString(io.netty.buffer.ByteBuf cb)

    - #### writeString

          public static void writeString(java.lang.String str,
                                         io.netty.buffer.ByteBuf cb)

    - #### sizeOfString

          public static int sizeOfString(java.lang.String str)

    - #### readLongString

          public static java.lang.String readLongString(io.netty.buffer.ByteBuf cb)

    - #### writeLongString

          public static void writeLongString(java.lang.String str,
                                             io.netty.buffer.ByteBuf cb)

    - #### sizeOfLongString

          public static int sizeOfLongString(java.lang.String str)

    - #### readBytes

          public static byte[] readBytes(io.netty.buffer.ByteBuf cb)

    - #### writeBytes

          public static void writeBytes(byte[] bytes,
                                        io.netty.buffer.ByteBuf cb)

    - #### sizeOfBytes

          public static int sizeOfBytes(byte[] bytes)

    - #### readBytesMap

          public static java.util.Map<java.lang.String,java.nio.ByteBuffer> readBytesMap(io.netty.buffer.ByteBuf cb)

    - #### writeBytesMap

          public static void writeBytesMap(java.util.Map<java.lang.String,java.nio.ByteBuffer> m,
                                           io.netty.buffer.ByteBuf cb)

    - #### sizeOfBytesMap

          public static int sizeOfBytesMap(java.util.Map<java.lang.String,java.nio.ByteBuffer> m)

    - #### readConsistencyLevel

          public static ConsistencyLevel readConsistencyLevel(io.netty.buffer.ByteBuf cb)

    - #### writeConsistencyLevel

          public static void writeConsistencyLevel(ConsistencyLevel consistency,
                                                   io.netty.buffer.ByteBuf cb)

    - #### sizeOfConsistencyLevel

          public static int sizeOfConsistencyLevel(ConsistencyLevel consistency)

    - #### readEnumValue

          public static <T extends java.lang.Enum<T>> T readEnumValue(java.lang.Class<T> enumType,
                                                                      io.netty.buffer.ByteBuf cb)

    - #### writeEnumValue

          public static <T extends java.lang.Enum<T>> void writeEnumValue(T enumValue,
                                                                          io.netty.buffer.ByteBuf cb)

    - #### sizeOfEnumValue

          public static <T extends java.lang.Enum<T>> int sizeOfEnumValue(T enumValue)

    - #### readUUID

          public static java.util.UUID readUUID(io.netty.buffer.ByteBuf cb)

    - #### writeUUID

          public static void writeUUID(java.util.UUID uuid,
                                       io.netty.buffer.ByteBuf cb)

    - #### sizeOfUUID

          public static int sizeOfUUID(java.util.UUID uuid)

    - #### readStringList

          public static java.util.List<java.lang.String> readStringList(io.netty.buffer.ByteBuf cb)

    - #### writeStringList

          public static void writeStringList(java.util.List<java.lang.String> l,
                                             io.netty.buffer.ByteBuf cb)

    - #### sizeOfStringList

          public static int sizeOfStringList(java.util.List<java.lang.String> l)

    - #### readStringMap

          public static java.util.Map<java.lang.String,java.lang.String> readStringMap(io.netty.buffer.ByteBuf cb)

    - #### writeStringMap

          public static void writeStringMap(java.util.Map<java.lang.String,java.lang.String> m,
                                            io.netty.buffer.ByteBuf cb)

    - #### sizeOfStringMap

          public static int sizeOfStringMap(java.util.Map<java.lang.String,java.lang.String> m)

    - #### readStringToStringListMap

          public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> readStringToStringListMap(io.netty.buffer.ByteBuf cb)

    - #### writeStringToStringListMap

          public static void writeStringToStringListMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> m,
                                                        io.netty.buffer.ByteBuf cb)

    - #### sizeOfStringToStringListMap

          public static int sizeOfStringToStringListMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> m)

    - #### readValue

          public static java.nio.ByteBuffer readValue(io.netty.buffer.ByteBuf cb)

    - #### readBoundValue

          public static java.nio.ByteBuffer readBoundValue(io.netty.buffer.ByteBuf cb,
                                                           ProtocolVersion protocolVersion)

    - #### writeValue

          public static void writeValue(byte[] bytes,
                                        io.netty.buffer.ByteBuf cb)

    - #### writeValue

          public static void writeValue(java.nio.ByteBuffer bytes,
                                        io.netty.buffer.ByteBuf cb)

    - #### sizeOfValue

          public static int sizeOfValue(byte[] bytes)

    - #### sizeOfValue

          public static int sizeOfValue(java.nio.ByteBuffer bytes)

    - #### sizeOfValue

          public static int sizeOfValue(int valueSize)

    - #### readValueList

          public static java.util.List<java.nio.ByteBuffer> readValueList(io.netty.buffer.ByteBuf cb,
                                                                          ProtocolVersion protocolVersion)

    - #### writeValueList

          public static void writeValueList(java.util.List<java.nio.ByteBuffer> values,
                                            io.netty.buffer.ByteBuf cb)

    - #### sizeOfValueList

          public static int sizeOfValueList(java.util.List<java.nio.ByteBuffer> values)

    - #### readNameAndValueList

          public static Pair<java.util.List<java.lang.String>,java.util.List<java.nio.ByteBuffer>> readNameAndValueList(io.netty.buffer.ByteBuf cb,
                                                                                                                        ProtocolVersion protocolVersion)

    - #### readInet

          public static java.net.InetSocketAddress readInet(io.netty.buffer.ByteBuf cb)

    - #### writeInet

          public static void writeInet(java.net.InetSocketAddress inet,
                                       io.netty.buffer.ByteBuf cb)

    - #### sizeOfInet

          public static int sizeOfInet(java.net.InetSocketAddress inet)

    - #### readInetAddr

          public static java.net.InetAddress readInetAddr(io.netty.buffer.ByteBuf cb)

    - #### writeInetAddr

          public static void writeInetAddr(java.net.InetAddress inetAddr,
                                           io.netty.buffer.ByteBuf cb)

    - #### sizeOfInetAddr

          public static int sizeOfInetAddr(java.net.InetAddress inetAddr)

    - #### readRawBytes

          public static byte[] readRawBytes(io.netty.buffer.ByteBuf cb)

Copyright © 2018 The Apache Software Foundation