use of com.thinkaurelius.titan.diskstorage.util.StaticByteBuffer in project titan by thinkaurelius.
the class KeyColumnValueStoreUtil method stringToByteBuffer.
// TODO rename as "stringToBuffer" after syntax errors are resolved
public static StaticBuffer stringToByteBuffer(String s) {
byte[] b;
try {
b = s.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
ByteBuffer bb = ByteBuffer.allocate(b.length);
bb.put(b);
bb.flip();
return new StaticByteBuffer(bb);
}
Aggregations