public class TcpIpChunkProvider extends Chunk implements ChunkProvider
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the chunk provider.
|
Chunk |
duplicate()
Duplicates the whole chunk.
|
Chunk |
duplicate(int off,
int t)
Partially duplicates this chunk.
|
protected void |
finalize() |
Chunk |
prepare()
Returns a chunk to read data from.
|
void |
release()
Releases the chunk.
|
public Chunk prepare() throws org.objectweb.jonathan.apis.kernel.JonathanException
ChunkProvider
When done with the chunk, its user must update its
offset
and top
members and
release
it.
ChunkProviders should not be used concurrently.
prepare
in interface ChunkProvider
org.objectweb.jonathan.apis.kernel.JonathanException
- if no chunk can be provided.public void close()
ChunkProvider
close
in interface ChunkProvider
public Chunk duplicate() throws org.objectweb.jonathan.apis.kernel.JonathanException
Chunk
The default implementation copies the buffer, and creates a new chunk with it.
public Chunk duplicate(int off, int t) throws org.objectweb.jonathan.apis.kernel.JonathanException
Chunk
The default implementation copies the appropriate portion of the buffer, and creates a new chunk with it.
public void release()
Chunk
The default implementation resets offset and top to 0.