gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-20 16:27:40 35 4
gpt4 key购买 nike

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

XByteBuffer.toBytes介绍

[英]Converts an integer to four bytes
[中]将整数转换为四个字节

代码示例

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

/**
 * Converts an integer to four bytes
 * @param n - the integer
 * @return - four bytes in an array
 * @deprecated use toBytes(boolean,byte[],int)
 */
public static byte[] toBytes(boolean bool) {
  byte[] b = new byte[1] ;
  return toBytes(bool,b,0);
}

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

/**
 * Converts an long to eight bytes
 * @param n - the long
 * @return - eight bytes in an array
 * @deprecated use toBytes(long,byte[],int)
 */
public static byte[] toBytes(long n) {
  return toBytes(n,new byte[8],0);
}
public static byte[] toBytes(long n, byte[] b, int offset) {

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

/**
 * Converts an integer to four bytes
 * @param n - the integer
 * @return - four bytes in an array
 * @deprecated use toBytes(int,byte[],int)
 */
public static byte[] toBytes(int n) {
  return toBytes(n,new byte[4],0);
}

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

/**
 * Converts an long to eight bytes
 * @param n - the long
 * @return - eight bytes in an array
 * @deprecated use toBytes(long,byte[],int)
 */
@Deprecated
public static byte[] toBytes(long n) {
  return toBytes(n,new byte[8],0);
}
public static byte[] toBytes(long n, byte[] b, int offset) {

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

/**
 * Converts a boolean to a 1-byte array
 * @param bool - the integer
 * @return - 1-byte array
 * @deprecated use toBytes(boolean,byte[],int)
 */
@Deprecated
public static byte[] toBytes(boolean bool) {
  byte[] b = new byte[1] ;
  return toBytes(bool,b,0);
}

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

/**
 * Converts an integer to four bytes
 * @param n - the integer
 * @return - four bytes in an array
 * @deprecated use toBytes(int,byte[],int)
 */
@Deprecated
public static byte[] toBytes(int n) {
  return toBytes(n,new byte[4],0);
}

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

public boolean append(int i) {
  int newcount = bufSize + 4;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public boolean append(int i) {
  int newcount = bufSize + 4;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public static byte[] createDataPackage(byte[] data, int doff, int dlength, byte[] buffer, int bufoff) {
  if ( (buffer.length-bufoff) > getDataPackageLength(dlength) ) {
    throw new ArrayIndexOutOfBoundsException("Unable to create data package, buffer is too small.");
  }
  System.arraycopy(START_DATA, 0, buffer, bufoff, START_DATA.length);
  toBytes(data.length,buffer, bufoff+START_DATA.length);
  System.arraycopy(data, doff, buffer, bufoff+START_DATA.length + 4, dlength);
  System.arraycopy(END_DATA, 0, buffer, bufoff+START_DATA.length + 4 + data.length, END_DATA.length);
  return buffer;
}

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

public boolean append(boolean i) {
  int newcount = bufSize + 1;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public static byte[] createDataPackage(byte[] data, int doff, int dlength, byte[] buffer, int bufoff) {
  if ( (buffer.length-bufoff) > getDataPackageLength(dlength) ) {
    throw new ArrayIndexOutOfBoundsException("Unable to create data package, buffer is too small.");
  }
  System.arraycopy(START_DATA, 0, buffer, bufoff, START_DATA.length);
  toBytes(data.length,buffer, bufoff+START_DATA.length);
  System.arraycopy(data, doff, buffer, bufoff+START_DATA.length + 4, dlength);
  System.arraycopy(END_DATA, 0, buffer, bufoff+START_DATA.length + 4 + data.length, END_DATA.length);
  return buffer;
}

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

public boolean append(long i) {
  int newcount = bufSize + 8;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public boolean append(int i) {
  int newcount = bufSize + 4;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public boolean append(boolean i) {
  int newcount = bufSize + 1;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public boolean append(long i) {
  int newcount = bufSize + 8;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public static byte[] createDataPackage(byte[] data, int doff, int dlength, byte[] buffer, int bufoff) {
  if ( (buffer.length-bufoff) > getDataPackageLength(dlength) ) {
    throw new ArrayIndexOutOfBoundsException("Unable to create data package, buffer is too small.");
  }
  System.arraycopy(START_DATA, 0, buffer, bufoff, START_DATA.length);
  toBytes(data.length,buffer, bufoff+START_DATA.length);
  System.arraycopy(data, doff, buffer, bufoff+START_DATA.length + 4, dlength);
  System.arraycopy(END_DATA, 0, buffer, bufoff+START_DATA.length + 4 + data.length, END_DATA.length);
  return buffer;
}

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

public boolean append(long i) {
  int newcount = bufSize + 8;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public boolean append(boolean i) {
  int newcount = bufSize + 1;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public boolean append(int i) {
  int newcount = bufSize + 4;
  if (newcount > buf.length) {
    expand(newcount);
  }
  XByteBuffer.toBytes(i,buf,bufSize);
  bufSize = newcount;
  return true;
}

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

public static byte[] createDataPackage(byte[] data, int doff, int dlength, byte[] buffer, int bufoff) {
  if ( (buffer.length-bufoff) > getDataPackageLength(dlength) ) {
    throw new ArrayIndexOutOfBoundsException(sm.getString("xByteBuffer.unableCreate"));
  }
  System.arraycopy(START_DATA, 0, buffer, bufoff, START_DATA.length);
  toBytes(data.length,buffer, bufoff+START_DATA.length);
  System.arraycopy(data, doff, buffer, bufoff+START_DATA.length + 4, dlength);
  System.arraycopy(END_DATA, 0, buffer, bufoff+START_DATA.length + 4 + data.length, END_DATA.length);
  return buffer;
}

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