com.alibaba.fastjson.asm
类 ByteVector

java.lang.Object
  继承者 com.alibaba.fastjson.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 new ByteVector with a default initial size.
ByteVector(int initialSize)
          Constructs a new ByteVector with the given initial size.
 
方法摘要
 ByteVector putByte(int b)
          Puts a byte into this byte vector.
 ByteVector putByteArray(byte[] b, int off, int len)
          Puts an array of bytes into this byte vector.
 ByteVector putInt(int i)
          Puts an int into this byte vector.
 ByteVector putShort(int s)
          Puts a short into this byte vector.
 ByteVector putUTF8(String s)
          Puts an UTF8 string into this byte vector.
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ByteVector

public ByteVector()
Constructs a new ByteVector with a default initial size.


ByteVector

public ByteVector(int initialSize)
Constructs a new ByteVector with the given initial size.

参数:
initialSize - the initial size of the byte vector to be constructed.
方法详细信息

putByte

public ByteVector putByte(int b)
Puts a byte into this byte vector. The byte vector is automatically enlarged if necessary.

参数:
b - a byte.
返回:
this byte vector.

putShort

public ByteVector putShort(int s)
Puts a short into this byte vector. The byte vector is automatically enlarged if necessary.

参数:
s - a short.
返回:
this byte vector.

putInt

public ByteVector putInt(int i)
Puts an int into this byte vector. The byte vector is automatically enlarged if necessary.

参数:
i - an int.
返回:
this byte vector.

putUTF8

public ByteVector putUTF8(String s)
Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary.

参数:
s - a String.
返回:
this byte vector.

putByteArray

public 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.

参数:
b - an array of bytes. May be null to put len null bytes into this byte vector.
off - index of the fist byte of b that must be copied.
len - number of bytes of b that must be copied.
返回:
this byte vector.


Copyright © 2012-2014 Alibaba Group. All Rights Reserved.