Methods Summary |
---|
private void | enlarge(int size)Enlarge this byte vector so that it can receive n more bytes.
int length1 = 2 * data.length;
int length2 = length + size;
byte[] newData = new byte[length1 > length2 ? length1 : length2];
System.arraycopy(data, 0, newData, 0, length);
data = newData;
|
oracle.toplink.libraries.asm.ByteVector | put11(int b1, int b2)Puts two bytes into this byte vector. The byte vector is automatically
enlarged if necessary.
int length = this.length;
if (length + 2 > data.length) {
enlarge(2);
}
byte[] data = this.data;
data[length++] = (byte)b1;
data[length++] = (byte)b2;
this.length = length;
return this;
|
oracle.toplink.libraries.asm.ByteVector | put12(int b, int s)Puts a byte and a short into this byte vector. The byte vector is
automatically enlarged if necessary.
int length = this.length;
if (length + 3 > data.length) {
enlarge(3);
}
byte[] data = this.data;
data[length++] = (byte)b;
data[length++] = (byte)(s >>> 8);
data[length++] = (byte)s;
this.length = length;
return this;
|
public oracle.toplink.libraries.asm.ByteVector | putByte(int b)Puts a byte into this byte vector. The byte vector is automatically
enlarged if necessary.
int length = this.length;
if (length + 1 > data.length) {
enlarge(1);
}
data[length++] = (byte)b;
this.length = length;
return this;
|
public oracle.toplink.libraries.asm.ByteVector | putByteArray(byte[] b, int off, int len)Puts an array of bytes into this byte vector. The byte vector is
automatically enlarged if necessary.
if (length + len > data.length) {
enlarge(len);
}
if (b != null) {
System.arraycopy(b, off, data, length, len);
}
length += len;
return this;
|
public oracle.toplink.libraries.asm.ByteVector | putInt(int i)Puts an int into this byte vector. The byte vector is automatically
enlarged if necessary.
int length = this.length;
if (length + 4 > data.length) {
enlarge(4);
}
byte[] data = this.data;
data[length++] = (byte)(i >>> 24);
data[length++] = (byte)(i >>> 16);
data[length++] = (byte)(i >>> 8);
data[length++] = (byte)i;
this.length = length;
return this;
|
public oracle.toplink.libraries.asm.ByteVector | putLong(long l)Puts a long into this byte vector. The byte vector is automatically
enlarged if necessary.
int length = this.length;
if (length + 8 > data.length) {
enlarge(8);
}
byte[] data = this.data;
int i = (int)(l >>> 32);
data[length++] = (byte)(i >>> 24);
data[length++] = (byte)(i >>> 16);
data[length++] = (byte)(i >>> 8);
data[length++] = (byte)i;
i = (int)l;
data[length++] = (byte)(i >>> 24);
data[length++] = (byte)(i >>> 16);
data[length++] = (byte)(i >>> 8);
data[length++] = (byte)i;
this.length = length;
return this;
|
public oracle.toplink.libraries.asm.ByteVector | putShort(int s)Puts a short into this byte vector. The byte vector is automatically
enlarged if necessary.
int length = this.length;
if (length + 2 > data.length) {
enlarge(2);
}
byte[] data = this.data;
data[length++] = (byte)(s >>> 8);
data[length++] = (byte)s;
this.length = length;
return this;
|
public oracle.toplink.libraries.asm.ByteVector | putUTF8(java.lang.String s)Puts an UTF8 string into this byte vector. The byte vector is automatically
enlarged if necessary.
int charLength = s.length();
int byteLength = 0;
for (int i = 0; i < charLength; ++i) {
char c = s.charAt(i);
if (c >= '\001" && c <= '\177") {
byteLength++;
} else if (c > '\u07FF") {
byteLength += 3;
} else {
byteLength += 2;
}
}
if (byteLength > 65535) {
throw new IllegalArgumentException();
}
int length = this.length;
if (length + 2 + byteLength > data.length) {
enlarge(2 + byteLength);
}
byte[] data = this.data;
data[length++] = (byte)(byteLength >>> 8);
data[length++] = (byte)(byteLength);
for (int i = 0; i < charLength; ++i) {
char c = s.charAt(i);
if (c >= '\001" && c <= '\177") {
data[length++] = (byte)c;
} else if (c > '\u07FF") {
data[length++] = (byte)(0xE0 | c >> 12 & 0xF);
data[length++] = (byte)(0x80 | c >> 6 & 0x3F);
data[length++] = (byte)(0x80 | c & 0x3F);
} else {
data[length++] = (byte)(0xC0 | c >> 6 & 0x1F);
data[length++] = (byte)(0x80 | c & 0x3F);
}
}
this.length = length;
return this;
|