org.apache.cassandra.transport

## Class CBUtil

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

-     public abstract class CBUtil
      extends java.lang.Object

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CBUtil.BufferBuilder`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.jboss.netty.buffer.ChannelBuffer` | `bytesToCB(byte[] bytes)`
    `static org.jboss.netty.buffer.ChannelBuffer` | `consistencyLevelToCB(ConsistencyLevel consistency)`
    `static <T extends java.lang.Enum<T>> org.jboss.netty.buffer.ChannelBuffer` | `enumValueToCB(T enumValue)`
    `static org.jboss.netty.buffer.ChannelBuffer` | `inetToCB(java.net.InetSocketAddress inet)`
    `static org.jboss.netty.buffer.ChannelBuffer` | `intToCB(int i)`
    `static org.jboss.netty.buffer.ChannelBuffer` | `longStringToCB(java.lang.String str)`
    `static byte[]` | `readBytes(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static ConsistencyLevel` | `readConsistencyLevel(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static <T extends java.lang.Enum<T>> T` | `readEnumValue(java.lang.Class<T> enumType, org.jboss.netty.buffer.ChannelBuffer cb)`
    `static java.net.InetSocketAddress` | `readInet(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static java.lang.String` | `readLongString(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static java.lang.String` | `readString(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static java.util.List<java.lang.String>` | `readStringList(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static java.util.Map<java.lang.String,java.lang.String>` | `readStringMap(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static java.util.Map<java.lang.String,java.util.List<java.lang.String>>` | `readStringToStringListMap(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static java.util.UUID` | `readUuid(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static java.nio.ByteBuffer` | `readValue(org.jboss.netty.buffer.ChannelBuffer cb)`
    `static org.jboss.netty.buffer.ChannelBuffer` | `shortToCB(int s)`
    `static org.jboss.netty.buffer.ChannelBuffer` | `stringToCB(java.lang.String str)`
    `static org.jboss.netty.buffer.ChannelBuffer` | `uuidToCB(java.util.UUID uuid)`
    `static void` | `writeStringList(org.jboss.netty.buffer.ChannelBuffer cb, java.util.List<java.lang.String> l)`
    `static void` | `writeStringMap(org.jboss.netty.buffer.ChannelBuffer cb, java.util.Map<java.lang.String,java.lang.String> m)`
    `static void` | `writeStringToStringListMap(org.jboss.netty.buffer.ChannelBuffer cb, java.util.Map<java.lang.String,java.util.List<java.lang.String>> m)`

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

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

- - ### Method Detail

    - #### readString

          public static java.lang.String readString(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### readLongString

          public static java.lang.String readLongString(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### shortToCB

          public static org.jboss.netty.buffer.ChannelBuffer shortToCB(int s)

    - #### intToCB

          public static org.jboss.netty.buffer.ChannelBuffer intToCB(int i)

    - #### stringToCB

          public static org.jboss.netty.buffer.ChannelBuffer stringToCB(java.lang.String str)

    - #### bytesToCB

          public static org.jboss.netty.buffer.ChannelBuffer bytesToCB(byte[] bytes)

    - #### readBytes

          public static byte[] readBytes(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### consistencyLevelToCB

          public static org.jboss.netty.buffer.ChannelBuffer consistencyLevelToCB(ConsistencyLevel consistency)

    - #### readConsistencyLevel

          public static ConsistencyLevel readConsistencyLevel(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### readEnumValue

          public static <T extends java.lang.Enum<T>> T readEnumValue(java.lang.Class<T> enumType,
                                                      org.jboss.netty.buffer.ChannelBuffer cb)

    - #### enumValueToCB

          public static <T extends java.lang.Enum<T>> org.jboss.netty.buffer.ChannelBuffer enumValueToCB(T enumValue)

    - #### uuidToCB

          public static org.jboss.netty.buffer.ChannelBuffer uuidToCB(java.util.UUID uuid)

    - #### readUuid

          public static java.util.UUID readUuid(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### longStringToCB

          public static org.jboss.netty.buffer.ChannelBuffer longStringToCB(java.lang.String str)

    - #### readStringList

          public static java.util.List<java.lang.String> readStringList(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### writeStringList

          public static void writeStringList(org.jboss.netty.buffer.ChannelBuffer cb,
                             java.util.List<java.lang.String> l)

    - #### readStringMap

          public static java.util.Map<java.lang.String,java.lang.String> readStringMap(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### writeStringMap

          public static void writeStringMap(org.jboss.netty.buffer.ChannelBuffer cb,
                            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(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### writeStringToStringListMap

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

    - #### readValue

          public static java.nio.ByteBuffer readValue(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### readInet

          public static java.net.InetSocketAddress readInet(org.jboss.netty.buffer.ChannelBuffer cb)

    - #### inetToCB

          public static org.jboss.netty.buffer.ChannelBuffer inetToCB(java.net.InetSocketAddress inet)

Copyright © 2014 The Apache Software Foundation