src/share/classes/jdk/internal/org/objectweb/asm/ByteVector.java
Print this page
*** 86,106 ****
/**
* Constructs a new {@link ByteVector ByteVector} with the given initial
* size.
*
! * @param initialSize the initial size of the byte vector to be constructed.
*/
public ByteVector(final int initialSize) {
data = new byte[initialSize];
}
/**
* Puts a byte into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param b a byte.
* @return this byte vector.
*/
public ByteVector putByte(final int b) {
int length = this.length;
if (length + 1 > data.length) {
--- 86,108 ----
/**
* Constructs a new {@link ByteVector ByteVector} with the given initial
* size.
*
! * @param initialSize
! * the initial size of the byte vector to be constructed.
*/
public ByteVector(final int initialSize) {
data = new byte[initialSize];
}
/**
* Puts a byte into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param b
! * a byte.
* @return this byte vector.
*/
public ByteVector putByte(final int b) {
int length = this.length;
if (length + 1 > data.length) {
*** 113,124 ****
/**
* Puts two bytes into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param b1 a byte.
! * @param b2 another byte.
* @return this byte vector.
*/
ByteVector put11(final int b1, final int b2) {
int length = this.length;
if (length + 2 > data.length) {
--- 115,128 ----
/**
* Puts two bytes into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param b1
! * a byte.
! * @param b2
! * another byte.
* @return this byte vector.
*/
ByteVector put11(final int b1, final int b2) {
int length = this.length;
if (length + 2 > data.length) {
*** 133,143 ****
/**
* Puts a short into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param s a short.
* @return this byte vector.
*/
public ByteVector putShort(final int s) {
int length = this.length;
if (length + 2 > data.length) {
--- 137,148 ----
/**
* Puts a short into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param s
! * a short.
* @return this byte vector.
*/
public ByteVector putShort(final int s) {
int length = this.length;
if (length + 2 > data.length) {
*** 152,163 ****
/**
* Puts a byte and a short into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
! * @param b a byte.
! * @param s a short.
* @return this byte vector.
*/
ByteVector put12(final int b, final int s) {
int length = this.length;
if (length + 3 > data.length) {
--- 157,170 ----
/**
* Puts a byte and a short into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
! * @param b
! * a byte.
! * @param s
! * a short.
* @return this byte vector.
*/
ByteVector put12(final int b, final int s) {
int length = this.length;
if (length + 3 > data.length) {
*** 173,183 ****
/**
* Puts an int into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param i an int.
* @return this byte vector.
*/
public ByteVector putInt(final int i) {
int length = this.length;
if (length + 4 > data.length) {
--- 180,191 ----
/**
* Puts an int into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param i
! * an int.
* @return this byte vector.
*/
public ByteVector putInt(final int i) {
int length = this.length;
if (length + 4 > data.length) {
*** 194,204 ****
/**
* Puts a long into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param l a long.
* @return this byte vector.
*/
public ByteVector putLong(final long l) {
int length = this.length;
if (length + 8 > data.length) {
--- 202,213 ----
/**
* Puts a long into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
! * @param l
! * a long.
* @return this byte vector.
*/
public ByteVector putLong(final long l) {
int length = this.length;
if (length + 8 > data.length) {
*** 221,231 ****
/**
* Puts an UTF8 string into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
! * @param s a String.
* @return this byte vector.
*/
public ByteVector putUTF8(final String s) {
int charLength = s.length();
int len = length;
--- 230,241 ----
/**
* Puts an UTF8 string into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
! * @param s
! * a String.
* @return this byte vector.
*/
public ByteVector putUTF8(final String s) {
int charLength = s.length();
int len = length;
*** 286,303 ****
/**
* Puts an array of bytes into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
! * @param b an array of bytes. May be <tt>null</tt> to put <tt>len</tt>
* null bytes into this byte vector.
! * @param off index of the fist byte of b that must be copied.
! * @param len number of bytes of b that must be copied.
* @return this byte vector.
*/
! public ByteVector putByteArray(final byte[] b, final int off, final int len)
! {
if (length + len > data.length) {
enlarge(len);
}
if (b != null) {
System.arraycopy(b, off, data, length, len);
--- 296,315 ----
/**
* Puts an array of bytes into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
! * @param b
! * an array of bytes. May be <tt>null</tt> to put <tt>len</tt>
* null bytes into this byte vector.
! * @param off
! * index of the fist byte of b that must be copied.
! * @param len
! * number of bytes of b that must be copied.
* @return this byte vector.
*/
! public ByteVector putByteArray(final byte[] b, final int off, final int len) {
if (length + len > data.length) {
enlarge(len);
}
if (b != null) {
System.arraycopy(b, off, data, length, len);
*** 307,317 ****
}
/**
* Enlarge this byte vector so that it can receive n more bytes.
*
! * @param size number of additional bytes that this byte vector should be
* able to receive.
*/
private void enlarge(final int size) {
int length1 = 2 * data.length;
int length2 = length + size;
--- 319,330 ----
}
/**
* Enlarge this byte vector so that it can receive n more bytes.
*
! * @param size
! * number of additional bytes that this byte vector should be
* able to receive.
*/
private void enlarge(final int size) {
int length1 = 2 * data.length;
int length2 = length + size;