net.i2p.client.streaming
class ByteCollector extends Object
Modifier and Type | Field and Description |
---|---|
(package private) byte[] |
contents
Deprecated.
|
(package private) int |
size
Deprecated.
|
Constructor and Description |
---|
ByteCollector()
Deprecated.
New collector with the default initial capacity
|
ByteCollector(byte b)
Deprecated.
New collector with the specified byte
|
ByteCollector(byte[] b)
Deprecated.
New collector containing the specified bytes
|
ByteCollector(int capacity)
Deprecated.
New collector with an initial capacity as specified
|
Modifier and Type | Method and Description |
---|---|
ByteCollector |
append(byte b)
Deprecated.
Add a new byte to the collector (extending the buffer if necessary)
|
ByteCollector |
append(byte[] b)
Deprecated.
Add new bytes to the collector (extending the buffer if necessary)
|
ByteCollector |
append(byte[] b,
int len)
Deprecated.
Add new bytes to the collector (extending the buffer if necessary)
|
ByteCollector |
append(byte[] b,
int off,
int len)
Deprecated.
Add new bytes to the collector (extending the buffer if necessary)
|
ByteCollector |
append(ByteCollector bc)
Deprecated.
Add the contents of the byte collector to the current collector (extending the buffer if necessary)
|
void |
clear()
Deprecated.
Empty the collector.
|
void |
clearAndShorten()
Deprecated.
Empty the collector and reduce its capacity.
|
boolean |
ensureCapacity(int cap)
Deprecated.
Make sure we have sufficient storage space.
|
boolean |
equals(Object o)
Deprecated.
Compare the collectors.
|
int |
getCurrentSize()
Deprecated.
How many bytes are available for retrieval?
|
int |
hashCode()
Deprecated.
|
int |
indexOf(byte b)
Deprecated.
Search through the collector for the first occurrence of the specified
byte
|
int |
indexOf(byte[] ba)
Deprecated.
Search through the collector for the first occurrence of the sequence of
bytes
|
int |
indexOf(ByteCollector bc)
Deprecated.
Search through the collector for the first occurrence of the sequence of
bytes contained within the specified collector
|
boolean |
isEmpty()
Deprecated.
Does the collector have meaningful data or is it empty?
|
byte |
removeFirst()
Deprecated.
Remove the first byte from the collector, shifting its contents accordingly.
|
byte[] |
startToByteArray(int maxlen)
Deprecated.
Pull off the first $maxlen bytes from the collector, shifting the remaining
bytes into the beginning of the collector's array.
|
byte[] |
toByteArray()
Deprecated.
Copy the contents of the collector into a new array and return it
|
String |
toString()
Deprecated.
Render the bytes as a string
|
public ByteCollector()
public ByteCollector(int capacity)
public ByteCollector(byte[] b)
public ByteCollector(byte b)
public ByteCollector append(byte b)
b
- byte to addpublic ByteCollector append(byte[] b)
b
- bytes to addpublic ByteCollector append(byte[] b, int len)
b
- byte array to add fromlen
- number of bytes in the array to addpublic ByteCollector append(byte[] b, int off, int len)
b
- byte array to add fromoff
- offset into the array to begin adding fromlen
- number of bytes in the array to addpublic ByteCollector append(ByteCollector bc)
bc
- collector to copypublic byte[] toByteArray()
public byte[] startToByteArray(int maxlen)
maxlen
- max number of bytes we want to pull from the collector (we will get
less if the collector doesnt have that many bytes yet)public int getCurrentSize()
public boolean ensureCapacity(int cap)
cap
- minimum number of bytes that the buffer should containpublic boolean isEmpty()
public int indexOf(ByteCollector bc)
bc
- bytes that will be searched forpublic int indexOf(byte b)
b
- byte that will be searched forpublic int indexOf(byte[] ba)
ba
- bytes that will be searched forpublic void clear()
public void clearAndShorten()
public String toString()
public boolean equals(Object o)
public byte removeFirst() throws IllegalArgumentException
IllegalArgumentException
- if the collector is empty