gpt4 book ai didi

org.apache.catalina.tribes.io.XByteBuffer.append()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 17:07:40 26 4
gpt4 key购买 nike

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

XByteBuffer.append介绍

[英]Appends the data to the buffer. If the data is incorrectly formatted, ie, the data should always start with the header, false will be returned and the data will be discarded.
[中]将数据附加到缓冲区。如果数据格式不正确,即数据应始终以标题开头,将返回false并丢弃数据。

代码示例

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Writes the specified byte to this output stream.
 *
 * @param b the <code>byte</code>.
 * @throws IOException if an I/O error occurs. In particular, an
 *   <code>IOException</code> may be thrown if the output stream has
 *   been closed.
 * TODO Implement this java.io.OutputStream method
 */
@Override
public void write(int b) throws IOException {
  buffer.append((byte)b);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

/**
 * Writes the specified byte to this output stream.
 *
 * @param b the <code>byte</code>.
 * @throws IOException if an I/O error occurs. In particular, an
 *   <code>IOException</code> may be thrown if the output stream has
 *   been closed.
 * TODO Implement this java.io.OutputStream method
 */
@Override
public void write(int b) throws IOException {
  buffer.append((byte)b);
}

代码示例来源:origin: org.apache.tomcat/tomcat-tribes

/**
 * Writes the specified byte to this output stream.
 *
 * @param b the <code>byte</code>.
 * @throws IOException if an I/O error occurs. In particular, an
 *   <code>IOException</code> may be thrown if the output stream has
 *   been closed.
 */
@Override
public void write(int b) throws IOException {
  buffer.append((byte)b);
}

代码示例来源:origin: codefollower/Tomcat-Research

public int append(byte[] data,int off,int len, boolean count) {
  buffer.append(data,off,len);
  int pkgCnt = -1;
  if ( count ) pkgCnt = buffer.countPackages();
  return pkgCnt;
}

代码示例来源:origin: org.apache.tomcat/tomcat-tribes

public int append(byte[] data,int off,int len, boolean count) {
  buffer.append(data,off,len);
  int pkgCnt = -1;
  if ( count ) pkgCnt = buffer.countPackages();
  return pkgCnt;
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

public int append(byte[] data,int off,int len, boolean count) throws java.io.IOException {
  buffer.append(data,off,len);
  int pkgCnt = -1;
  if ( count ) pkgCnt = buffer.countPackages();
  return pkgCnt;
}

代码示例来源:origin: codefollower/Tomcat-Research

public ChannelMessage assemble() {
  if ( !complete() ) throw new IllegalStateException("Fragments are missing.");
  int buffersize = 0;
  for (int i=0; i<frags.length; i++ ) buffersize += frags[i].getLength();
  XByteBuffer buf = new XByteBuffer(buffersize,false);
  msg.setMessage(buf);
  for ( int i=0; i<frags.length; i++ ) {
    msg.getMessage().append(frags[i].getBytesDirect(),0,frags[i].getLength());
  }
  return msg;
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

public ChannelMessage assemble() {
  if ( !complete() ) throw new IllegalStateException("Fragments are missing.");
  int buffersize = 0;
  for (int i=0; i<frags.length; i++ ) buffersize += frags[i].getLength();
  XByteBuffer buf = new XByteBuffer(buffersize,false);
  msg.setMessage(buf);
  for ( int i=0; i<frags.length; i++ ) {
    msg.getMessage().append(frags[i].getBytesDirect(),0,frags[i].getLength());
  }
  return msg;
}

代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

public ChannelMessage assemble() {
  if ( !complete() ) throw new IllegalStateException("Fragments are missing.");
  int buffersize = 0;
  for (int i=0; i<frags.length; i++ ) buffersize += frags[i].getLength();
  XByteBuffer buf = new XByteBuffer(buffersize,false);
  msg.setMessage(buf);
  for ( int i=0; i<frags.length; i++ ) {
    msg.getMessage().append(frags[i].getBytesDirect(),0,frags[i].getLength());
  }
  return msg;
}

代码示例来源:origin: org.apache.tomcat/tomcat-tribes

public ChannelMessage assemble() {
  if ( !complete() ) throw new IllegalStateException(sm.getString("fragmentationInterceptor.fragments.missing"));
  int buffersize = 0;
  for (int i=0; i<frags.length; i++ ) buffersize += frags[i].getLength();
  XByteBuffer buf = new XByteBuffer(buffersize,false);
  msg.setMessage(buf);
  for ( int i=0; i<frags.length; i++ ) {
    msg.getMessage().append(frags[i].getBytesDirect(),0,frags[i].getLength());
  }
  return msg;
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
  int size = msg.getMessage().getLength();
  boolean frag = (size>maxSize) && okToProcess(msg.getOptions());
  if ( frag ) {
    frag(destination, msg, payload);
  } else {
    msg.getMessage().append(frag);
    super.sendMessage(destination, msg, payload);
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat-tribes

@Override
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
  int size = msg.getMessage().getLength();
  boolean frag = (size>maxSize) && okToProcess(msg.getOptions());
  if ( frag ) {
    frag(destination, msg, payload);
  } else {
    msg.getMessage().append(frag);
    super.sendMessage(destination, msg, payload);
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

@Override
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
  int size = msg.getMessage().getLength();
  boolean frag = (size>maxSize) && okToProcess(msg.getOptions());
  if ( frag ) {
    frag(destination, msg, payload);
  } else {
    msg.getMessage().append(frag);
    super.sendMessage(destination, msg, payload);
  }
}

代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
  int size = msg.getMessage().getLength();
  boolean frag = (size>maxSize) && okToProcess(msg.getOptions());
  if ( frag ) {
    frag(destination, msg, payload);
  } else {
    msg.getMessage().append(frag);
    super.sendMessage(destination, msg, payload);
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public void messageReceived(ChannelMessage msg) {
  try {
    byte[] data = decompress(msg.getMessage().getBytes());
    msg.getMessage().trim(msg.getMessage().getLength());
    msg.getMessage().append(data,0,data.length);
    super.messageReceived(msg);
  } catch ( IOException x ) {
    log.error("Unable to decompress byte contents",x);
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
  try {
    byte[] data = compress(msg.getMessage().getBytes());
    msg.getMessage().trim(msg.getMessage().getLength());
    msg.getMessage().append(data,0,data.length);
    super.sendMessage(destination, msg, payload);
  } catch ( IOException x ) {
    log.error("Unable to compress byte contents");
    throw new ChannelException(x);
  }
}

代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

public void messageReceived(ChannelMessage msg) {
  try {
    byte[] data = decompress(msg.getMessage().getBytes());
    msg.getMessage().trim(msg.getMessage().getLength());
    msg.getMessage().append(data,0,data.length);
    getPrevious().messageReceived(msg);
  } catch ( IOException x ) {
    log.error("Unable to decompress byte contents",x);
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

@Override
public void messageReceived(ChannelMessage msg) {
  try {
    byte[] data = decompress(msg.getMessage().getBytes());
    msg.getMessage().trim(msg.getMessage().getLength());
    msg.getMessage().append(data,0,data.length);
    getPrevious().messageReceived(msg);
  } catch ( IOException x ) {
    log.error("Unable to decompress byte contents",x);
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

@Override
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
  try {
    byte[] data = compress(msg.getMessage().getBytes());
    msg.getMessage().trim(msg.getMessage().getLength());
    msg.getMessage().append(data,0,data.length);
    getNext().sendMessage(destination, msg, payload);
  } catch ( IOException x ) {
    log.error("Unable to compress byte contents");
    throw new ChannelException(x);
  }
}

代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
  try {
    byte[] data = compress(msg.getMessage().getBytes());
    msg.getMessage().trim(msg.getMessage().getLength());
    msg.getMessage().append(data,0,data.length);
    getNext().sendMessage(destination, msg, payload);
  } catch ( IOException x ) {
    log.error("Unable to compress byte contents");
    throw new ChannelException(x);
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com