Package org.springframework.asm
Class ByteVector
java.lang.Object
org.springframework.asm.ByteVector
A dynamically extensible vector of bytes. This class is roughly equivalent to a DataOutputStream
 on top of a ByteArrayOutputStream, but is more efficient.
- Author:
- Eric Bruneton
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a newByteVectorwith a default initial capacity.ByteVector(int initialCapacity) Constructs a newByteVectorwith the given initial capacity.
- 
Method SummaryModifier and TypeMethodDescriptionputByte(int byteValue) Puts a byte into this byte vector.putByteArray(byte[] byteArrayValue, int byteOffset, int byteLength) Puts an array of bytes into this byte vector.putInt(int intValue) Puts an int into this byte vector.putLong(long longValue) Puts a long into this byte vector.putShort(int shortValue) Puts a short into this byte vector.Puts an UTF8 string into this byte vector.intsize()Returns the actual number of bytes in this vector.
- 
Constructor Details- 
ByteVectorpublic ByteVector()Constructs a newByteVectorwith a default initial capacity.
- 
ByteVectorpublic ByteVector(int initialCapacity) Constructs a newByteVectorwith the given initial capacity.- Parameters:
- initialCapacity- the initial capacity of the byte vector to be constructed.
 
 
- 
- 
Method Details- 
sizepublic int size()Returns the actual number of bytes in this vector.- Returns:
- the actual number of bytes in this vector.
 
- 
putBytePuts a byte into this byte vector. The byte vector is automatically enlarged if necessary.- Parameters:
- byteValue- a byte.
- Returns:
- this byte vector.
 
- 
putShortPuts a short into this byte vector. The byte vector is automatically enlarged if necessary.- Parameters:
- shortValue- a short.
- Returns:
- this byte vector.
 
- 
putIntPuts an int into this byte vector. The byte vector is automatically enlarged if necessary.- Parameters:
- intValue- an int.
- Returns:
- this byte vector.
 
- 
putLongPuts a long into this byte vector. The byte vector is automatically enlarged if necessary.- Parameters:
- longValue- a long.
- Returns:
- this byte vector.
 
- 
putUTF8Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary.- Parameters:
- stringValue- a String whose UTF8 encoded length must be less than 65536.
- Returns:
- this byte vector.
 
- 
putByteArrayPuts an array of bytes into this byte vector. The byte vector is automatically enlarged if necessary.- Parameters:
- byteArrayValue- an array of bytes. May be null to put- byteLengthnull 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.
- Returns:
- this byte vector.
 
 
-