org.objectweb.jonathan.apis.resources
Interface ChunkProvider


public interface ChunkProvider

Chunk providers are used to wrap input streams (like, e.g., socket input streams) in unmarshallers.

See Also:
MarshallerFactory

Method Summary
 void close()
          Closes the chunk provider.
 Chunk prepare()
          Returns a chunk to read data from.
 

Method Detail

prepare

public Chunk prepare()
              throws org.objectweb.jonathan.apis.kernel.JonathanException
Returns a chunk to read data from.

When done with the chunk, its user must update its offset and top members and release it.

ChunkProviders should not be used concurrently.

Returns:
a chunk;
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if no chunk can be provided.

close

public void close()
Closes the chunk provider. This method must be called if the target provider is no longer used.