本文整理了Java中org.apache.sshd.common.util.buffer.Buffer.ensureCapacity()
方法的一些代码示例,展示了Buffer.ensureCapacity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.ensureCapacity()
方法的具体详情如下:
包路径:org.apache.sshd.common.util.buffer.Buffer
类名称:Buffer
方法名:ensureCapacity
暂无
代码示例来源:origin: org.apache.sshd/sshd-osgi
protected void ensureCapacity(int capacity) {
ensureCapacity(capacity, BufferUtils.DEFAULT_BUFFER_GROWTH_FACTOR);
}
代码示例来源:origin: org.apache.sshd/sshd-common
protected void ensureCapacity(int capacity) {
ensureCapacity(capacity, BufferUtils.DEFAULT_BUFFER_GROWTH_FACTOR);
}
代码示例来源:origin: org.apache.sshd/sshd-osgi
public void putByte(byte b) {
ensureCapacity(Byte.BYTES);
workBuf[0] = b;
putRawBytes(workBuf, 0, Byte.BYTES);
}
代码示例来源:origin: org.apache.sshd/sshd-common
public void putByte(byte b) {
ensureCapacity(Byte.BYTES);
workBuf[0] = b;
putRawBytes(workBuf, 0, Byte.BYTES);
}
代码示例来源:origin: org.apache.sshd/sshd-common
/**
* Writes 16 bits
*
* @param i The 16-bit value
*/
public void putShort(int i) {
ensureCapacity(Short.BYTES);
workBuf[0] = (byte) (i >> 8);
workBuf[1] = (byte) i;
putRawBytes(workBuf, 0, Short.BYTES);
}
代码示例来源:origin: org.apache.sshd/sshd-osgi
/**
* Writes 16 bits
*
* @param i The 16-bit value
*/
public void putShort(int i) {
ensureCapacity(Short.BYTES);
workBuf[0] = (byte) (i >> 8);
workBuf[1] = (byte) i;
putRawBytes(workBuf, 0, Short.BYTES);
}
代码示例来源:origin: org.apache.sshd/sshd-osgi
/**
* Writes 64 bits
*
* @param i The 64-bit value
*/
public void putLong(long i) {
ensureCapacity(Long.BYTES);
workBuf[0] = (byte) (i >> 56);
workBuf[1] = (byte) (i >> 48);
workBuf[2] = (byte) (i >> 40);
workBuf[3] = (byte) (i >> 32);
workBuf[4] = (byte) (i >> 24);
workBuf[5] = (byte) (i >> 16);
workBuf[6] = (byte) (i >> 8);
workBuf[7] = (byte) i;
putRawBytes(workBuf, 0, Long.BYTES);
}
代码示例来源:origin: org.apache.sshd/sshd-common
/**
* Writes 64 bits
*
* @param i The 64-bit value
*/
public void putLong(long i) {
ensureCapacity(Long.BYTES);
workBuf[0] = (byte) (i >> 56);
workBuf[1] = (byte) (i >> 48);
workBuf[2] = (byte) (i >> 40);
workBuf[3] = (byte) (i >> 32);
workBuf[4] = (byte) (i >> 24);
workBuf[5] = (byte) (i >> 16);
workBuf[6] = (byte) (i >> 8);
workBuf[7] = (byte) i;
putRawBytes(workBuf, 0, Long.BYTES);
}
代码示例来源:origin: org.apache.sshd/sshd-osgi
/**
* Writes 32 bits
*
* @param i The 32-bit value
*/
public void putInt(long i) {
BufferUtils.validateInt32Value(i, "Invalid 32-bit value: %d");
ensureCapacity(Integer.BYTES);
BufferUtils.putUInt(i, workBuf, 0, Integer.BYTES);
putRawBytes(workBuf, 0, Integer.BYTES);
}
代码示例来源:origin: org.apache.sshd/sshd-common
/**
* Writes 32 bits
*
* @param i The 32-bit value
*/
public void putInt(long i) {
BufferUtils.validateInt32Value(i, "Invalid 32-bit value: %d");
ensureCapacity(Integer.BYTES);
BufferUtils.putUInt(i, workBuf, 0, Integer.BYTES);
putRawBytes(workBuf, 0, Integer.BYTES);
}
代码示例来源:origin: org.apache.sshd/sshd-sftp
buffer.ensureCapacity(readLen + Long.SIZE /* the header */, IntUnaryOperator.identity());
内容来源于网络,如有侵权,请联系作者删除!