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.

### Method Summary

Methods
`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 byte[]` `readRawBytes(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 java.util.List<java.nio.ByteBuffer>` `readValueList(org.jboss.netty.buffer.ChannelBuffer cb)`
`static int` `sizeOfBytes(byte[] bytes)`
`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` `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` `sizeOfValueList(java.util.List<java.nio.ByteBuffer> values)`
`static void` `writeBytes(byte[] bytes, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeConsistencyLevel(ConsistencyLevel consistency, org.jboss.netty.buffer.ChannelBuffer cb)`
`static <T extends java.lang.Enum<T>> void` `writeEnumValue(T enumValue, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeInet(java.net.InetSocketAddress inet, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeLongString(java.lang.String str, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeString(java.lang.String str, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeStringList(java.util.List<java.lang.String> l, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeStringMap(java.util.Map<java.lang.String,java.lang.String> m, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeStringToStringListMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> m, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeUUID(java.util.UUID uuid, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeValue(byte[] bytes, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeValue(java.nio.ByteBuffer bytes, org.jboss.netty.buffer.ChannelBuffer cb)`
`static void` `writeValueList(java.util.List<java.nio.ByteBuffer> values, org.jboss.netty.buffer.ChannelBuffer cb)`

### 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)

#### writeString

    public static void writeString(java.lang.String str,
                   org.jboss.netty.buffer.ChannelBuffer cb)

#### sizeOfString

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

#### readLongString

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

#### writeLongString

    public static void writeLongString(java.lang.String str,
                       org.jboss.netty.buffer.ChannelBuffer cb)

#### sizeOfLongString

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

#### readBytes

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

#### writeBytes

    public static void writeBytes(byte[] bytes,
                  org.jboss.netty.buffer.ChannelBuffer cb)

#### sizeOfBytes

    public static int sizeOfBytes(byte[] bytes)

#### readConsistencyLevel

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

#### writeConsistencyLevel

    public static void writeConsistencyLevel(ConsistencyLevel consistency,
                             org.jboss.netty.buffer.ChannelBuffer cb)

#### sizeOfConsistencyLevel

    public static int sizeOfConsistencyLevel(ConsistencyLevel consistency)

#### readEnumValue

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

#### writeEnumValue

    public static <T extends java.lang.Enum<T>> void writeEnumValue(T enumValue,
                                                    org.jboss.netty.buffer.ChannelBuffer cb)

#### sizeOfEnumValue

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

#### readUUID

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

#### writeUUID

    public static void writeUUID(java.util.UUID uuid,
                 org.jboss.netty.buffer.ChannelBuffer cb)

#### sizeOfUUID

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

#### readStringList

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

#### writeStringList

    public static void writeStringList(java.util.List<java.lang.String> l,
                       org.jboss.netty.buffer.ChannelBuffer 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(org.jboss.netty.buffer.ChannelBuffer cb)

#### writeStringMap

    public static void writeStringMap(java.util.Map<java.lang.String,java.lang.String> m,
                      org.jboss.netty.buffer.ChannelBuffer 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(org.jboss.netty.buffer.ChannelBuffer cb)

#### writeStringToStringListMap

    public static void writeStringToStringListMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> m,
                                  org.jboss.netty.buffer.ChannelBuffer 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(org.jboss.netty.buffer.ChannelBuffer cb)

#### writeValue

    public static void writeValue(byte[] bytes,
                  org.jboss.netty.buffer.ChannelBuffer cb)

#### writeValue

    public static void writeValue(java.nio.ByteBuffer bytes,
                  org.jboss.netty.buffer.ChannelBuffer cb)

#### sizeOfValue

    public static int sizeOfValue(byte[] bytes)

#### sizeOfValue

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

#### readValueList

    public static java.util.List<java.nio.ByteBuffer> readValueList(org.jboss.netty.buffer.ChannelBuffer cb)

#### writeValueList

    public static void writeValueList(java.util.List<java.nio.ByteBuffer> values,
                      org.jboss.netty.buffer.ChannelBuffer cb)

#### sizeOfValueList

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

#### readInet

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

#### writeInet

    public static void writeInet(java.net.InetSocketAddress inet,
                 org.jboss.netty.buffer.ChannelBuffer cb)

#### sizeOfInet

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

#### readRawBytes

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