本文整理了Java中org.apache.http.util.ByteArrayBuffer.expand()
方法的一些代码示例,展示了ByteArrayBuffer.expand()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteArrayBuffer.expand()
方法的具体详情如下:
包路径:org.apache.http.util.ByteArrayBuffer
类名称:ByteArrayBuffer
方法名:expand
暂无
代码示例来源:origin: robovm/robovm
public void append(int b) {
int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: robovm/robovm
public void append(final char[] b, int off, int len) {
if (b == null) {
return;
}
if ((off <0) || (off > b.length) || (len <0) ||
((off + len) <0) || ((off + len) > b.length)) {
throw new IndexOutOfBoundsException();
}
if (len == 0) {
return;
}
int oldlen = this.len;
int newlen = oldlen + len;
if (newlen > this.buffer.length) {
expand(newlen);
}
for (int i1 = off, i2 = oldlen; i2
}
this.len = newlen;
}
代码示例来源:origin: robovm/robovm
public void append(final byte[] b, int off, int len) {
if (b == null) {
return;
}
if ((off <0) || (off > b.length) || (len <0) ||
((off + len) <0) || ((off + len) > b.length)) {
throw new IndexOutOfBoundsException();
}
if (len == 0) {
return;
}
int newlen = this.len + len;
if (newlen > this.buffer.length) {
expand(newlen);
}
System.arraycopy(b, off, this.buffer, this.len, len);
this.len = newlen;
}
代码示例来源:origin: MobiVM/robovm
public void append(int b) {
int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: FlexoVM/flexovm
public void append(int b) {
int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
public void append(int b) {
int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: com.gluonhq/robovm-rt
public void append(int b) {
int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: Nextdoor/bender
/**
* Appends {@code b} byte to this buffer. The capacity of the buffer
* is increased, if necessary, to accommodate the additional byte.
*
* @param b the byte to be appended.
*/
public void append(final int b) {
final int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Appends {@code b} byte to this buffer. The capacity of the buffer
* is increased, if necessary, to accommodate the additional byte.
*
* @param b the byte to be appended.
*/
public void append(final int b) {
final int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: ibinti/bugvm
/**
* Appends {@code b} byte to this buffer. The capacity of the buffer
* is increased, if necessary, to accommodate the additional byte.
*
* @param b the byte to be appended.
*/
public void append(final int b) {
final int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Appends {@code b} byte to this buffer. The capacity of the buffer
* is increased, if necessary, to accommodate the additional byte.
*
* @param b the byte to be appended.
*/
public void append(final int b) {
final int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpcore
/**
* Appends b
byte to this buffer. The capacity of the buffer
* is increased, if necessary, to accommodate the additional byte.
*
* @param b the byte to be appended.
*/
public void append(final int b) {
final int newlen = this.len + 1;
if (newlen > this.buffer.length) {
expand(newlen);
}
this.buffer[this.len] = (byte)b;
this.len = newlen;
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpcore
/**
* Ensures that the capacity is at least equal to the specified minimum.
* If the current capacity is less than the argument, then a new internal
* array is allocated with greater capacity. If the required
* argument is non-positive, this method takes no action.
*
* @param required the minimum required capacity.
*
* @since 4.1
*/
public void ensureCapacity(final int required) {
if (required <= 0) {
return;
}
final int available = this.buffer.length - this.len;
if (required > available) {
expand(this.len + required);
}
}
代码示例来源:origin: ibinti/bugvm
/**
* Ensures that the capacity is at least equal to the specified minimum.
* If the current capacity is less than the argument, then a new internal
* array is allocated with greater capacity. If the {@code required}
* argument is non-positive, this method takes no action.
*
* @param required the minimum required capacity.
*
* @since 4.1
*/
public void ensureCapacity(final int required) {
if (required <= 0) {
return;
}
final int available = this.buffer.length - this.len;
if (required > available) {
expand(this.len + required);
}
}
代码示例来源:origin: Nextdoor/bender
/**
* Ensures that the capacity is at least equal to the specified minimum.
* If the current capacity is less than the argument, then a new internal
* array is allocated with greater capacity. If the {@code required}
* argument is non-positive, this method takes no action.
*
* @param required the minimum required capacity.
*
* @since 4.1
*/
public void ensureCapacity(final int required) {
if (required <= 0) {
return;
}
final int available = this.buffer.length - this.len;
if (required > available) {
expand(this.len + required);
}
}
代码示例来源:origin: MobiVM/robovm
public void append(final char[] b, int off, int len) {
if (b == null) {
return;
}
if ((off <0) || (off > b.length) || (len <0) ||
((off + len) <0) || ((off + len) > b.length)) {
throw new IndexOutOfBoundsException();
}
if (len == 0) {
return;
}
int oldlen = this.len;
int newlen = oldlen + len;
if (newlen > this.buffer.length) {
expand(newlen);
}
for (int i1 = off, i2 = oldlen; i2
}
this.len = newlen;
}
代码示例来源:origin: MobiVM/robovm
public void append(final byte[] b, int off, int len) {
if (b == null) {
return;
}
if ((off <0) || (off > b.length) || (len <0) ||
((off + len) <0) || ((off + len) > b.length)) {
throw new IndexOutOfBoundsException();
}
if (len == 0) {
return;
}
int newlen = this.len + len;
if (newlen > this.buffer.length) {
expand(newlen);
}
System.arraycopy(b, off, this.buffer, this.len, len);
this.len = newlen;
}
代码示例来源:origin: com.gluonhq/robovm-rt
public void append(final byte[] b, int off, int len) {
if (b == null) {
return;
}
if ((off <0) || (off > b.length) || (len <0) ||
((off + len) <0) || ((off + len) > b.length)) {
throw new IndexOutOfBoundsException();
}
if (len == 0) {
return;
}
int newlen = this.len + len;
if (newlen > this.buffer.length) {
expand(newlen);
}
System.arraycopy(b, off, this.buffer, this.len, len);
this.len = newlen;
}
代码示例来源:origin: FlexoVM/flexovm
public void append(final byte[] b, int off, int len) {
if (b == null) {
return;
}
if ((off <0) || (off > b.length) || (len <0) ||
((off + len) <0) || ((off + len) > b.length)) {
throw new IndexOutOfBoundsException();
}
if (len == 0) {
return;
}
int newlen = this.len + len;
if (newlen > this.buffer.length) {
expand(newlen);
}
System.arraycopy(b, off, this.buffer, this.len, len);
this.len = newlen;
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
public void append(final byte[] b, int off, int len) {
if (b == null) {
return;
}
if ((off <0) || (off > b.length) || (len <0) ||
((off + len) <0) || ((off + len) > b.length)) {
throw new IndexOutOfBoundsException();
}
if (len == 0) {
return;
}
int newlen = this.len + len;
if (newlen > this.buffer.length) {
expand(newlen);
}
System.arraycopy(b, off, this.buffer, this.len, len);
this.len = newlen;
}