类 ByteVector
- java.lang.Object
- org.springframework.asm.ByteVector
public class ByteVector extends Object
A dynamically extensible vector of bytes. This class is roughly equivalent to a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient.- 作者:
- Eric Bruneton
构造器概要
构造器 构造器 说明 ByteVector()Constructs a newByteVectorwith a default initial capacity.ByteVector(int initialCapacity)Constructs a newByteVectorwith the given initial capacity.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ByteVectorputByte(int byteValue)Puts a byte into this byte vector.ByteVectorputByteArray(byte[] byteArrayValue, int byteOffset, int byteLength)Puts an array of bytes into this byte vector.ByteVectorputInt(int intValue)Puts an int into this byte vector.ByteVectorputLong(long longValue)Puts a long into this byte vector.ByteVectorputShort(int shortValue)Puts a short into this byte vector.ByteVectorputUTF8(String stringValue)Puts an UTF8 string into this byte vector.
构造器详细资料
ByteVector
public ByteVector()
Constructs a newByteVectorwith a default initial capacity.
ByteVector
public ByteVector(int initialCapacity)
Constructs a newByteVectorwith the given initial capacity.- 参数:
initialCapacity- the initial capacity of the byte vector to be constructed.
方法详细资料
putByte
public ByteVector putByte(int byteValue)
Puts a byte into this byte vector. The byte vector is automatically enlarged if necessary.- 参数:
byteValue- a byte.- 返回:
- this byte vector.
putShort
public ByteVector putShort(int shortValue)
Puts a short into this byte vector. The byte vector is automatically enlarged if necessary.- 参数:
shortValue- a short.- 返回:
- this byte vector.
putInt
public ByteVector putInt(int intValue)
Puts an int into this byte vector. The byte vector is automatically enlarged if necessary.- 参数:
intValue- an int.- 返回:
- this byte vector.
putLong
public ByteVector putLong(long longValue)
Puts a long into this byte vector. The byte vector is automatically enlarged if necessary.- 参数:
longValue- a long.- 返回:
- this byte vector.
putUTF8
public ByteVector putUTF8(String stringValue)
Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary.- 参数:
stringValue- a String whose UTF8 encoded length must be less than 65536.- 返回:
- this byte vector.
putByteArray
public ByteVector putByteArray(byte[] byteArrayValue, int byteOffset, int byteLength)
Puts an array of bytes into this byte vector. The byte vector is automatically enlarged if necessary.- 参数:
byteArrayValue- an array of bytes. May be null to putbyteLengthnull bytes into this byte vector.byteOffset- index of the first byte of byteArrayValue that must be copied.byteLength- number of bytes of byteArrayValue that must be copied.- 返回:
- this byte vector.