org.fusesource.hawtbuf.Buffer.moveHead()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(120)

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

Buffer.moveHead介绍

暂无

代码示例

代码示例来源:origin: org.fusesource.stompjms/stompjms-client

public static String decodeHeader(Buffer value) {
  if (value == null)
    return null;
  ByteArrayOutputStream rc = new ByteArrayOutputStream(value.length);
  Buffer pos = new Buffer(value);
  int max = value.offset + value.length;
  while (pos.offset < max) {
    if (pos.startsWith(ESCAPE_ESCAPE_SEQ)) {
      rc.write(ESCAPE_BYTE);
      pos.moveHead(2);
    } else if (pos.startsWith(COLON_ESCAPE_SEQ)) {
      rc.write(COLON_BYTE);
      pos.moveHead(2);
    } else if (pos.startsWith(NEWLINE_ESCAPE_SEQ)) {
      rc.write(NEWLINE_BYTE);
      pos.moveHead(2);
    } else {
      rc.write(pos.data[pos.offset]);
      pos.moveHead(1);
    }
  }
  try {
    return new String(rc.toByteArray(), "UTF-8");
  } catch (UnsupportedEncodingException e) {
    throw new RuntimeException(e); // not expected.
  }
}

代码示例来源:origin: fusesource/stompjms

public static String decodeHeader(Buffer value) {
  if (value == null)
    return null;
  ByteArrayOutputStream rc = new ByteArrayOutputStream(value.length);
  Buffer pos = new Buffer(value);
  int max = value.offset + value.length;
  while (pos.offset < max) {
    if (pos.startsWith(ESCAPE_ESCAPE_SEQ)) {
      rc.write(ESCAPE_BYTE);
      pos.moveHead(2);
    } else if (pos.startsWith(COLON_ESCAPE_SEQ)) {
      rc.write(COLON_BYTE);
      pos.moveHead(2);
    } else if (pos.startsWith(NEWLINE_ESCAPE_SEQ)) {
      rc.write(NEWLINE_BYTE);
      pos.moveHead(2);
    } else {
      rc.write(pos.data[pos.offset]);
      pos.moveHead(1);
    }
  }
  try {
    return new String(rc.toByteArray(), "UTF-8");
  } catch (UnsupportedEncodingException e) {
    throw new RuntimeException(e); // not expected.
  }
}

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

try {
  int count = protonTransport.input(frame.data, frame.offset, frame.length);
  frame.moveHead(count);
} catch (Throwable e) {
  handleException(new AmqpProtocolException("Could not decode AMQP frame: " + frame, true, e));

代码示例来源:origin: org.apache.activemq/activemq-osgi

try {
  int count = protonTransport.input(frame.data, frame.offset, frame.length);
  frame.moveHead(count);
} catch (Throwable e) {
  handleException(new AmqpProtocolException("Could not decode AMQP frame: " + frame, true, e));

代码示例来源:origin: org.apache.qpid/proton-hawtdispatch

if( sender.getCredit() > 0 ) {
  int sent = sender.send(currentBuffer.data, currentBuffer.offset, currentBuffer.length);
  currentBuffer.moveHead(sent);
  if( currentBuffer.length == 0 ) {
    Delivery current = currentDelivery;

代码示例来源:origin: org.apache.activemq/activemq-osgi

int sent = getEndpoint().send(currentBuffer.data, currentBuffer.offset, currentBuffer.length);
if (sent > 0) {
  currentBuffer.moveHead(sent);
  if (currentBuffer.length == 0) {
    if (presettle) {

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

int sent = getEndpoint().send(currentBuffer.data, currentBuffer.offset, currentBuffer.length);
if (sent > 0) {
  currentBuffer.moveHead(sent);
  if (currentBuffer.length == 0) {
    if (presettle) {

相关文章