org.apache.cassandra.utils.Hex.hexToBytes()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中org.apache.cassandra.utils.Hex.hexToBytes()方法的一些代码示例,展示了Hex.hexToBytes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hex.hexToBytes()方法的具体详情如下:
包路径:org.apache.cassandra.utils.Hex
类名称:Hex
方法名:hexToBytes

Hex.hexToBytes介绍

暂无

代码示例

代码示例来源:origin: palantir/atlasdb

@Override
  public Token fromString(String string)
  {
    if (string.length() % 2 == 1)
      string = "0" + string;
    return new AtlasBytesToken(Hex.hexToBytes(string));
  }
};

代码示例来源:origin: palantir/atlasdb

@Override
public void validate(String token) throws ConfigurationException
{
  try
  {
    if (token.length() % 2 == 1)
      token = "0" + token;
    Hex.hexToBytes(token);
  }
  catch (NumberFormatException e)
  {
    throw new ConfigurationException("Token " + token + " contains non-hex digits");
  }
}

代码示例来源:origin: Impetus/Kundera

case MD5:
  authenticated = MessageDigest.isEqual(FBUtilities.threadLocalMD5Digest().digest(password.getBytes()),
      Hex.hexToBytes(props.getProperty(username)));
  break;
default:

代码示例来源:origin: org.apache.cassandra/cassandra-all

public static ByteBuffer hexToBytes(String str)
{
  return ByteBuffer.wrap(Hex.hexToBytes(str));
}

代码示例来源:origin: org.apache.cassandra/cassandra-clientutil

public static ByteBuffer hexToBytes(String str)
{
  return ByteBuffer.wrap(Hex.hexToBytes(str));
}

代码示例来源:origin: jsevellec/cassandra-unit

public static ByteBuffer hexToBytes(String str)
{
  return ByteBuffer.wrap(Hex.hexToBytes(str));
}

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public static ByteBuffer hexToBytes(String str)
{
  return ByteBuffer.wrap(Hex.hexToBytes(str));
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public static ByteBuffer hexToBytes(String str)
{
  return ByteBuffer.wrap(Hex.hexToBytes(str));
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public static ByteBuffer hexToBytes(String str)
{
  return ByteBuffer.wrap(Hex.hexToBytes(str));
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public ByteBuffer fromString(String source)
{
  try
  {
    return ByteBuffer.wrap(Hex.hexToBytes(source));
  }
  catch (NumberFormatException e)
  {
    throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e);
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

public Token fromString(String string)
  {
    if (string.length() % 2 == 1)
      string = "0" + string;
    return new BytesToken(Hex.hexToBytes(string));
  }
};

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public Token fromString(String string)
  {
    if (string.length() % 2 == 1)
      string = "0" + string;
    return new BytesToken(Hex.hexToBytes(string));
  }
};

代码示例来源:origin: jsevellec/cassandra-unit

public void validate(String token) throws ConfigurationException
{
  try
  {
    if (token.length() % 2 == 1)
      token = "0" + token;
    Hex.hexToBytes(token);
  }
  catch (NumberFormatException e)
  {
    throw new ConfigurationException("Token " + token + " contains non-hex digits");
  }
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public Token fromString(String string)
  {
    if (string.length() % 2 == 1)
      string = "0" + string;
    return new BytesToken(Hex.hexToBytes(string));
  }
};

代码示例来源:origin: org.apache.cassandra/cassandra-all

public Token fromString(String string)
  {
    if (string.length() % 2 == 1)
      string = "0" + string;
    return new BytesToken(Hex.hexToBytes(string));
  }
};

代码示例来源:origin: jsevellec/cassandra-unit

public ByteBuffer fromString(String source)
{
  try
  {
    return ByteBuffer.wrap(Hex.hexToBytes(source));
  }
  catch (NumberFormatException e)
  {
    throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e);
  }
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public ByteBuffer fromString(String source)
{
  try
  {
    return ByteBuffer.wrap(Hex.hexToBytes(source));
  }
  catch (NumberFormatException e)
  {
    throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e);
  }
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public ByteBuffer fromString(String source)
{
  try
  {
    return ByteBuffer.wrap(Hex.hexToBytes(source));
  }
  catch (NumberFormatException e)
  {
    throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e);
  }
}

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public ByteBuffer fromString(String source)
{
  try
  {
    return ByteBuffer.wrap(Hex.hexToBytes(source));
  }
  catch (NumberFormatException e)
  {
    throw new MarshalException(String.format("cannot parse '%s' as hex bytes", source), e);
  }
}

代码示例来源:origin: Stratio/cassandra-lucene-index

private String base(String value) {
    try {
      byte[] bytes = Hex.hexToBytes(value.replaceFirst("0x", ""));
      return Hex.bytesToHex(bytes);
    } catch (NumberFormatException e) {
      throw new IndexException(e, "Field '{}' requires an hex string, but found '{}'", field, value);
    }
  }
}

相关文章