Package org.gearman.util
Class ByteArrayBuffer
- java.lang.Object
-
- org.gearman.util.ByteArrayBuffer
-
- All Implemented Interfaces:
Serializable
public class ByteArrayBuffer extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ByteArrayBuffer()
ByteArrayBuffer(byte[] bytes)
ByteArrayBuffer(byte[] bytes, int copyBufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteArrayBuffer
append(byte b)
ByteArrayBuffer
append(byte[] bytes)
ByteArrayBuffer
append(byte[] bytes, int startPosition, int len)
ByteArrayBuffer
append(InputStream is)
byte[]
getBytes()
int
indexOf(byte b)
int
indexOf(byte b, int fromIndex)
int
lastIndexOf(byte b)
int
lastIndexOf(byte b, int fromIndex)
int
length()
List<byte[]>
split(byte[] pattern)
List<byte[]>
split(byte[] pattern, int limit)
byte[]
subArray(int beginIndex, int endIndex)
The intest of this method is to be similar toString.substring(int, int)
Returns a new byte[] that is a sub-array of this array.String
toHex()
String
toString()
-
-
-
Method Detail
-
getBytes
public byte[] getBytes()
-
append
public ByteArrayBuffer append(byte[] bytes)
-
append
public ByteArrayBuffer append(byte b)
-
append
public ByteArrayBuffer append(byte[] bytes, int startPosition, int len)
-
append
public ByteArrayBuffer append(InputStream is)
-
length
public int length()
-
subArray
public byte[] subArray(int beginIndex, int endIndex)
The intest of this method is to be similar toString.substring(int, int)
Returns a new byte[] that is a sub-array of this array. The sub-array begins at the specifiedbeginIndex
and extends to the byte at indexendIndex - 1
. Thus the length of the sub-array isendIndex-beginIndex
.- Parameters:
beginIndex
- the beginning index, inclusive.endIndex
- the ending index, exclusive.- Returns:
- the specified substring.
- Throws:
IndexOutOfBoundsException
- if thebeginIndex
is negative, orendIndex
is larger than the length of thisbyte[]
, orbeginIndex
is larger thanendIndex
.
-
indexOf
public int indexOf(byte b)
-
indexOf
public int indexOf(byte b, int fromIndex)
-
lastIndexOf
public int lastIndexOf(byte b)
-
lastIndexOf
public int lastIndexOf(byte b, int fromIndex)
-
toHex
public String toHex()
-
split
public List<byte[]> split(byte[] pattern)
-
split
public List<byte[]> split(byte[] pattern, int limit)
-
-