Codota Logo
ByteBufferUtil.writeShortLength
Code IndexAdd Codota to your IDE (free)

How to use
writeShortLength
method
in
org.apache.cassandra.utils.ByteBufferUtil

Best Java code snippets using org.apache.cassandra.utils.ByteBufferUtil.writeShortLength (Showing top 17 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: jsevellec/cassandra-unit

  public void serializeComparator(ByteBuffer bb)
  {
    int header = 0;
    if (isAlias)
      header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF);
    else
      header = comparatorName.length();
    ByteBufferUtil.writeShortLength(bb, header);
    if (!isAlias)
      bb.put(ByteBufferUtil.bytes(comparatorName));
  }
}
origin: com.strapdata.cassandra/cassandra-all

  public void serializeComparator(ByteBuffer bb)
  {
    int header = 0;
    if (isAlias)
      header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF);
    else
      header = comparatorName.length();
    ByteBufferUtil.writeShortLength(bb, header);
    if (!isAlias)
      bb.put(ByteBufferUtil.bytes(comparatorName));
  }
}
origin: com.facebook.presto.cassandra/cassandra-server

  public void serializeComparator(ByteBuffer bb)
  {
    int header = 0;
    if (isAlias)
      header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF);
    else
      header = comparatorName.length();
    ByteBufferUtil.writeShortLength(bb, header);
    if (!isAlias)
      bb.put(ByteBufferUtil.bytes(comparatorName));
  }
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

  public void serializeComparator(ByteBuffer bb)
  {
    int header = 0;
    if (isAlias)
      header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF);
    else
      header = comparatorName.length();
    ByteBufferUtil.writeShortLength(bb, header);
    if (!isAlias)
      bb.put(ByteBufferUtil.bytes(comparatorName));
  }
}
origin: org.apache.cassandra/cassandra-all

  public void serializeComparator(ByteBuffer bb)
  {
    int header = 0;
    if (isAlias)
      header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF);
    else
      header = comparatorName.length();
    ByteBufferUtil.writeShortLength(bb, header);
    if (!isAlias)
      bb.put(ByteBufferUtil.bytes(comparatorName));
  }
}
origin: com.facebook.presto.cassandra/cassandra-server

public static ByteBuffer build(ByteBuffer... buffers)
{
  int totalLength = 0;
  for (ByteBuffer bb : buffers)
    totalLength += 2 + bb.remaining() + 1;
  ByteBuffer out = ByteBuffer.allocate(totalLength);
  for (ByteBuffer bb : buffers)
  {
    ByteBufferUtil.writeShortLength(out, bb.remaining());
    out.put(bb.duplicate());
    out.put((byte) 0);
  }
  out.flip();
  return out;
}
origin: org.apache.cassandra/cassandra-all

public static ByteBuffer build(boolean isStatic, ByteBuffer... buffers)
{
  int totalLength = isStatic ? 2 : 0;
  for (ByteBuffer bb : buffers)
    totalLength += 2 + bb.remaining() + 1;
  ByteBuffer out = ByteBuffer.allocate(totalLength);
  if (isStatic)
    out.putShort((short)STATIC_MARKER);
  for (ByteBuffer bb : buffers)
  {
    ByteBufferUtil.writeShortLength(out, bb.remaining());
    int toCopy = bb.remaining();
    ByteBufferUtil.arrayCopy(bb, bb.position(), out, out.position(), toCopy);
    out.position(out.position() + toCopy);
    out.put((byte) 0);
  }
  out.flip();
  return out;
}
origin: jsevellec/cassandra-unit

public static ByteBuffer build(boolean isStatic, ByteBuffer... buffers)
{
  int totalLength = isStatic ? 2 : 0;
  for (ByteBuffer bb : buffers)
    totalLength += 2 + bb.remaining() + 1;
  ByteBuffer out = ByteBuffer.allocate(totalLength);
  if (isStatic)
    out.putShort((short)STATIC_MARKER);
  for (ByteBuffer bb : buffers)
  {
    ByteBufferUtil.writeShortLength(out, bb.remaining());
    int toCopy = bb.remaining();
    ByteBufferUtil.arrayCopy(bb, bb.position(), out, out.position(), toCopy);
    out.position(out.position() + toCopy);
    out.put((byte) 0);
  }
  out.flip();
  return out;
}
origin: com.strapdata.cassandra/cassandra-all

public static ByteBuffer build(boolean isStatic, ByteBuffer... buffers)
{
  int totalLength = isStatic ? 2 : 0;
  for (ByteBuffer bb : buffers)
    totalLength += 2 + bb.remaining() + 1;
  ByteBuffer out = ByteBuffer.allocate(totalLength);
  if (isStatic)
    out.putShort((short)STATIC_MARKER);
  for (ByteBuffer bb : buffers)
  {
    ByteBufferUtil.writeShortLength(out, bb.remaining());
    int toCopy = bb.remaining();
    ByteBufferUtil.arrayCopy(bb, bb.position(), out, out.position(), toCopy);
    out.position(out.position() + toCopy);
    out.put((byte) 0);
  }
  out.flip();
  return out;
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public static ByteBuffer build(boolean isStatic, ByteBuffer... buffers)
{
  int totalLength = isStatic ? 2 : 0;
  for (ByteBuffer bb : buffers)
    totalLength += 2 + bb.remaining() + 1;
  ByteBuffer out = ByteBuffer.allocate(totalLength);
  if (isStatic)
    out.putShort((short)STATIC_MARKER);
  for (ByteBuffer bb : buffers)
  {
    ByteBufferUtil.writeShortLength(out, bb.remaining());
    int toCopy = bb.remaining();
    ByteBufferUtil.arrayCopy(bb, bb.position(), out, out.position(), toCopy);
    out.position(out.position() + toCopy);
    out.put((byte) 0);
  }
  out.flip();
  return out;
}
origin: com.facebook.presto.cassandra/cassandra-server

public ByteBuffer toByteBuffer()
{
  // This is the legacy format of composites.
  // See org.apache.cassandra.db.marshal.CompositeType for details.
  ByteBuffer result = ByteBuffer.allocate(dataSize() + 3 * size() + (isStatic() ? 2 : 0));
  if (isStatic())
    ByteBufferUtil.writeShortLength(result, CompositeType.STATIC_MARKER);
  for (int i = 0; i < size(); i++)
  {
    ByteBuffer bb = get(i);
    ByteBufferUtil.writeShortLength(result, bb.remaining());
    result.put(bb.duplicate());
    result.put((byte)0);
  }
  result.flip();
  return result;
}
origin: com.facebook.presto.cassandra/cassandra-server

public ByteBuffer toByteBuffer()
{
  // for simple sparse we just return our one name buffer
  switch (nametype())
  {
    case SIMPLE_DENSE:
    case SIMPLE_SPARSE:
      return get(0);
    case COMPOUND_DENSE:
    case COMPOUND_SPARSE_STATIC:
    case COMPOUND_SPARSE:
      // This is the legacy format of composites.
      // See org.apache.cassandra.db.marshal.CompositeType for details.
      ByteBuffer result = ByteBuffer.allocate(cellDataSize());
      if (isStatic())
        ByteBufferUtil.writeShortLength(result, CompositeType.STATIC_MARKER);
      for (int i = 0; i < size(); i++)
      {
        ByteBuffer bb = get(i);
        ByteBufferUtil.writeShortLength(result, bb.remaining());
        result.put(bb);
        result.put((byte) 0);
      }
      result.flip();
      return result;
    default:
      throw new AssertionError();
  }
}
origin: org.apache.cassandra/cassandra-all

ByteBufferUtil.writeShortLength(bb, component.remaining());
origin: jsevellec/cassandra-unit

ByteBufferUtil.writeShortLength(bb, component.remaining());
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

ByteBufferUtil.writeShortLength(bb, component.remaining());
origin: com.strapdata.cassandra/cassandra-all

ByteBufferUtil.writeShortLength(bb, component.remaining());
origin: com.facebook.presto.cassandra/cassandra-server

ByteBufferUtil.writeShortLength(bb, component.remaining());
org.apache.cassandra.utilsByteBufferUtilwriteShortLength

Popular methods of ByteBufferUtil

  • bytes
  • string
    Decode a String representation.
  • bytesToHex
  • getArray
    You should almost never use this. Instead, use the write* methods to avoid copies.
  • clone
  • hexToBytes
  • toFloat
  • toInt
    Convert a byte buffer to an integer. Does not change the byte buffer position.
  • toLong
  • toDouble
  • readBytes
  • arrayCopy
  • readBytes,
  • arrayCopy,
  • compareUnsigned,
  • read,
  • readShortLength,
  • compareSubArrays,
  • ensureCapacity,
  • getShortLength,
  • minimalBufferFor,
  • readBytesWithShortLength

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now