本文整理汇总了Java中org.apache.cassandra.utils.ByteBufferUtil.bytesToHex方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBufferUtil.bytesToHex方法的具体用法?Java ByteBufferUtil.bytesToHex怎么用?Java ByteBufferUtil.bytesToHex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.utils.ByteBufferUtil
的用法示例。
在下文中一共展示了ByteBufferUtil.bytesToHex方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readString
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
private static String readString(ByteBuf cb, int length)
{
if (length == 0)
return "";
ByteBuffer buffer = cb.nioBuffer(cb.readerIndex(), length);
try
{
String str = decodeString(buffer);
cb.readerIndex(cb.readerIndex() + length);
return str;
}
catch (IllegalStateException | CharacterCodingException e)
{
throw new ProtocolException("Cannot decode string as UTF8: '" + ByteBufferUtil.bytesToHex(buffer) + "'; " + e);
}
}
示例2: stringify
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
private static String stringify(ByteBuffer name)
{
try
{
return UTF8Type.instance.getString(name);
}
catch (Exception e)
{
return ByteBufferUtil.bytesToHex(name);
}
}
示例3: compareCollectionMembers
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public int compareCollectionMembers(ByteBuffer o1, ByteBuffer o2, ByteBuffer collectionName)
{
CollectionType t = defined.get(collectionName);
if (t == null)
throw new RuntimeException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection");
return t.nameComparator().compare(o1, o2);
}
示例4: validateCollectionMember
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public void validateCollectionMember(ByteBuffer bytes, ByteBuffer collectionName) throws MarshalException
{
CollectionType t = defined.get(collectionName);
if (t == null)
throw new MarshalException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection");
t.nameComparator().validate(bytes);
}
示例5: deserialize
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public String deserialize(ByteBuffer bytes)
{
try
{
return ByteBufferUtil.string(bytes, charset);
}
catch (CharacterCodingException e)
{
throw new MarshalException("Invalid " + charset + " bytes " + ByteBufferUtil.bytesToHex(bytes));
}
}
示例6: toString
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
@Override
public String toString()
{
return ByteBufferUtil.bytesToHex(bytes);
}
示例7: toString
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
@Override
public String toString()
{
return mark == null ? "null" : ByteBufferUtil.bytesToHex(mark);
}
示例8: toString
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
@Override
public String toString()
{
String keystring = getKey() == null ? "null" : ByteBufferUtil.bytesToHex(getKey());
return "DecoratedKey(" + getToken() + ", " + keystring + ")";
}
示例9: toJSONString
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
@Override
public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion)
{
return "\"0x" + ByteBufferUtil.bytesToHex(buffer) + '"';
}
示例10: getString
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public String getString(ByteBuffer bytes)
{
return ByteBufferUtil.bytesToHex(bytes);
}
示例11: toString
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public String toString(ByteBuffer value)
{
return ByteBufferUtil.bytesToHex(value);
}