- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.setLength()
方法的一些代码示例,展示了XByteBuffer.setLength()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XByteBuffer.setLength()
方法的具体详情如下:
包路径:org.apache.catalina.tribes.io.XByteBuffer
类名称:XByteBuffer
方法名:setLength
暂无
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Extracts the message bytes from a package.
* If no package exists, a IllegalStateException will be thrown.
* @param clearFromBuffer - if true, the package will be removed from the byte buffer
* @return - returns the actual message bytes (header, compress,size and footer not included).
*/
public XByteBuffer extractDataPackage(boolean clearFromBuffer) {
int psize = countPackages(true);
if (psize == 0) {
throw new java.lang.IllegalStateException("No package exists in XByteBuffer");
}
int size = toInt(buf, START_DATA.length);
XByteBuffer xbuf = BufferPool.getBufferPool().getBuffer(size,false);
xbuf.setLength(size);
System.arraycopy(buf, START_DATA.length + 4, xbuf.getBytesDirect(), 0, size);
if (clearFromBuffer) {
int totalsize = START_DATA.length + 4 + size + END_DATA.length;
bufSize = bufSize - totalsize;
System.arraycopy(buf, totalsize, buf, 0, bufSize);
}
return xbuf;
}
代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource
/**
* Extracts the message bytes from a package.
* If no package exists, a IllegalStateException will be thrown.
* @param clearFromBuffer - if true, the package will be removed from the byte buffer
* @return - returns the actual message bytes (header, compress,size and footer not included).
*/
public XByteBuffer extractDataPackage(boolean clearFromBuffer) {
int psize = countPackages(true);
if (psize == 0) {
throw new java.lang.IllegalStateException("No package exists in XByteBuffer");
}
int size = toInt(buf, START_DATA.length);
XByteBuffer xbuf = BufferPool.getBufferPool().getBuffer(size,false);
xbuf.setLength(size);
System.arraycopy(buf, START_DATA.length + 4, xbuf.getBytesDirect(), 0, size);
if (clearFromBuffer) {
int totalsize = START_DATA.length + 4 + size + END_DATA.length;
bufSize = bufSize - totalsize;
System.arraycopy(buf, totalsize, buf, 0, bufSize);
}
return xbuf;
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes
/**
* Extracts the message bytes from a package.
* If no package exists, a IllegalStateException will be thrown.
* @param clearFromBuffer - if true, the package will be removed from the byte buffer
* @return - returns the actual message bytes (header, compress,size and footer not included).
*/
public XByteBuffer extractDataPackage(boolean clearFromBuffer) {
int psize = countPackages(true);
if (psize == 0) {
throw new java.lang.IllegalStateException("No package exists in XByteBuffer");
}
int size = toInt(buf, START_DATA.length);
XByteBuffer xbuf = BufferPool.getBufferPool().getBuffer(size,false);
xbuf.setLength(size);
System.arraycopy(buf, START_DATA.length + 4, xbuf.getBytesDirect(), 0, size);
if (clearFromBuffer) {
int totalsize = START_DATA.length + 4 + size + END_DATA.length;
bufSize = bufSize - totalsize;
System.arraycopy(buf, totalsize, buf, 0, bufSize);
}
return xbuf;
}
代码示例来源:origin: org.apache.tomcat/tomcat-tribes
/**
* Extracts the message bytes from a package.
* If no package exists, a IllegalStateException will be thrown.
* @param clearFromBuffer - if true, the package will be removed from the byte buffer
* @return - returns the actual message bytes (header, compress,size and footer not included).
*/
public XByteBuffer extractDataPackage(boolean clearFromBuffer) {
int psize = countPackages(true);
if (psize == 0) {
throw new java.lang.IllegalStateException(sm.getString("xByteBuffer.no.package"));
}
int size = toInt(buf, START_DATA.length);
XByteBuffer xbuf = BufferPool.getBufferPool().getBuffer(size,false);
xbuf.setLength(size);
System.arraycopy(buf, START_DATA.length + 4, xbuf.getBytesDirect(), 0, size);
if (clearFromBuffer) {
int totalsize = START_DATA.length + 4 + size + END_DATA.length;
bufSize = bufSize - totalsize;
System.arraycopy(buf, totalsize, buf, 0, bufSize);
}
return xbuf;
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Deserializes a ChannelData object from a byte array
* @param xbuf byte[]
* @return ChannelData
*/
public static ChannelData getDataFromPackage(XByteBuffer xbuf) {
ChannelData data = new ChannelData(false);
int offset = 0;
data.setOptions(XByteBuffer.toInt(xbuf.getBytesDirect(),offset));
offset += 4; //options
data.setTimestamp(XByteBuffer.toLong(xbuf.getBytesDirect(),offset));
offset += 8; //timestamp
data.uniqueId = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
offset += 4; //uniqueId length
System.arraycopy(xbuf.getBytesDirect(),offset,data.uniqueId,0,data.uniqueId.length);
offset += data.uniqueId.length; //uniqueId data
//byte[] addr = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
int addrlen = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //addr length
//System.arraycopy(xbuf.getBytesDirect(),offset,addr,0,addr.length);
data.setAddress(MemberImpl.getMember(xbuf.getBytesDirect(),offset,addrlen));
//offset += addr.length; //addr data
offset += addrlen;
int xsize = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //xsize length
System.arraycopy(xbuf.getBytesDirect(),offset,xbuf.getBytesDirect(),0,xsize);
xbuf.setLength(xsize);
data.message = xbuf;
return data;
}
代码示例来源:origin: org.apache.tomcat/tomcat-tribes
/**
* Deserializes a ChannelData object from a byte array
* @param xbuf byte[]
* @return ChannelData
*/
public static ChannelData getDataFromPackage(XByteBuffer xbuf) {
ChannelData data = new ChannelData(false);
int offset = 0;
data.setOptions(XByteBuffer.toInt(xbuf.getBytesDirect(),offset));
offset += 4; //options
data.setTimestamp(XByteBuffer.toLong(xbuf.getBytesDirect(),offset));
offset += 8; //timestamp
data.uniqueId = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
offset += 4; //uniqueId length
System.arraycopy(xbuf.getBytesDirect(),offset,data.uniqueId,0,data.uniqueId.length);
offset += data.uniqueId.length; //uniqueId data
//byte[] addr = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
int addrlen = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //addr length
//System.arraycopy(xbuf.getBytesDirect(),offset,addr,0,addr.length);
data.setAddress(MemberImpl.getMember(xbuf.getBytesDirect(),offset,addrlen));
//offset += addr.length; //addr data
offset += addrlen;
int xsize = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //xsize length
System.arraycopy(xbuf.getBytesDirect(),offset,xbuf.getBytesDirect(),0,xsize);
xbuf.setLength(xsize);
data.message = xbuf;
return data;
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes
/**
* Deserializes a ChannelData object from a byte array
* @param xbuf byte[]
* @return ChannelData
*/
public static ChannelData getDataFromPackage(XByteBuffer xbuf) {
ChannelData data = new ChannelData(false);
int offset = 0;
data.setOptions(XByteBuffer.toInt(xbuf.getBytesDirect(),offset));
offset += 4; //options
data.setTimestamp(XByteBuffer.toLong(xbuf.getBytesDirect(),offset));
offset += 8; //timestamp
data.uniqueId = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
offset += 4; //uniqueId length
System.arraycopy(xbuf.getBytesDirect(),offset,data.uniqueId,0,data.uniqueId.length);
offset += data.uniqueId.length; //uniqueId data
//byte[] addr = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
int addrlen = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //addr length
//System.arraycopy(xbuf.getBytesDirect(),offset,addr,0,addr.length);
data.setAddress(MemberImpl.getMember(xbuf.getBytesDirect(),offset,addrlen));
//offset += addr.length; //addr data
offset += addrlen;
int xsize = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //xsize length
System.arraycopy(xbuf.getBytesDirect(),offset,xbuf.getBytesDirect(),0,xsize);
xbuf.setLength(xsize);
data.message = xbuf;
return data;
}
代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource
/**
* Deserializes a ChannelData object from a byte array
* @param b byte[]
* @return ChannelData
*/
public static ChannelData getDataFromPackage(XByteBuffer xbuf) {
ChannelData data = new ChannelData(false);
int offset = 0;
data.setOptions(XByteBuffer.toInt(xbuf.getBytesDirect(),offset));
offset += 4; //options
data.setTimestamp(XByteBuffer.toLong(xbuf.getBytesDirect(),offset));
offset += 8; //timestamp
data.uniqueId = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
offset += 4; //uniqueId length
System.arraycopy(xbuf.getBytesDirect(),offset,data.uniqueId,0,data.uniqueId.length);
offset += data.uniqueId.length; //uniqueId data
//byte[] addr = new byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
int addrlen = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //addr length
//System.arraycopy(xbuf.getBytesDirect(),offset,addr,0,addr.length);
data.setAddress(MemberImpl.getMember(xbuf.getBytesDirect(),offset,addrlen));
//offset += addr.length; //addr data
offset += addrlen;
int xsize = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
offset += 4; //xsize length
System.arraycopy(xbuf.getBytesDirect(),offset,xbuf.getBytesDirect(),0,xsize);
xbuf.setLength(xsize);
data.message = xbuf;
return data;
}
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.getCapacity()方法的一些代码示例,展示了XByteBuffer.getCapacit
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.extractPackage()方法的一些代码示例,展示了XByteBuffer.extract
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.clear()方法的一些代码示例,展示了XByteBuffer.clear()的具体用法。这些代
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.firstIndexOf()方法的一些代码示例,展示了XByteBuffer.firstInde
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.toBytes()方法的一些代码示例,展示了XByteBuffer.toBytes()的具体用法
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.setLength()方法的一些代码示例,展示了XByteBuffer.setLength()的
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.serialize()方法的一些代码示例,展示了XByteBuffer.serialize()的
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.getBytes()方法的一些代码示例,展示了XByteBuffer.getBytes()的具体
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.expand()方法的一些代码示例,展示了XByteBuffer.expand()的具体用法。这
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.toLong()方法的一些代码示例,展示了XByteBuffer.toLong()的具体用法。这
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.getBytesDirect()方法的一些代码示例,展示了XByteBuffer.getByte
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.toInt()方法的一些代码示例,展示了XByteBuffer.toInt()的具体用法。这些代
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.()方法的一些代码示例,展示了XByteBuffer.()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.trim()方法的一些代码示例,展示了XByteBuffer.trim()的具体用法。这些代码示
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.createDataPackage()方法的一些代码示例,展示了XByteBuffer.crea
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.reset()方法的一些代码示例,展示了XByteBuffer.reset()的具体用法。这些代
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.toBoolean()方法的一些代码示例,展示了XByteBuffer.toBoolean()的
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.countPackages()方法的一些代码示例,展示了XByteBuffer.countPac
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.doesPackageExist()方法的一些代码示例,展示了XByteBuffer.doesP
本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.deserialize()方法的一些代码示例,展示了XByteBuffer.deserializ
我是一名优秀的程序员,十分优秀!