Package org.hcjf.io.net.http
Class HttpPackage.ChunkedDecoderLayer
- java.lang.Object
-
- org.hcjf.layers.Layer
-
- org.hcjf.io.net.http.HttpPackage.ChunkedDecoderLayer
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler,HttpPackage.TransferDecodingLayerInterface,LayerInterface
- Enclosing class:
- HttpPackage
public static class HttpPackage.ChunkedDecoderLayer extends Layer implements HttpPackage.TransferDecodingLayerInterface
This decoder implementation resolve the chunked encoding method for http.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hcjf.layers.Layer
Layer.Access, Layer.LayerAgent, Layer.LayerAgentMBean
-
-
Constructor Summary
Constructors Constructor Description ChunkedDecoderLayer()
-
Method Summary
Modifier and Type Method Description voidadd(java.nio.ByteBuffer bodyFragment)Adds a fragment of the body into the internal buffer.booleandone(HttpPackage httpPackage)Verify if the body is complete.byte[]getBody()Returns the accumulated body, if the body is complete then this accumulated body is the complete body.-
Methods inherited from class org.hcjf.layers.Layer
checkAccess, getAliases, getImplName, getLayer, getProxy, getSession, getTarget, invoke, isOverwritable, isPlugin, isStateful
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hcjf.layers.LayerInterface
getImplName, getRegex, isDistributed, isPlugin, isStateful
-
-
-
-
Method Detail
-
add
public void add(java.nio.ByteBuffer bodyFragment)
Adds a fragment of the body into the internal buffer.- Specified by:
addin interfaceHttpPackage.TransferDecodingLayerInterface- Parameters:
bodyFragment- Body fragment.
-
done
public boolean done(HttpPackage httpPackage)
Verify if the body is complete. The body is complete when the chunked size into the fragment is zero. * @param httpPackage Package to verify if the body is complete. For this particular implementation this param is unuseful.- Specified by:
donein interfaceHttpPackage.TransferDecodingLayerInterface- Parameters:
httpPackage- Package to verify if the body is complete.- Returns:
- True if the body is complete and false in the otherwise
-
getBody
public byte[] getBody()
Returns the accumulated body, if the body is complete then this accumulated body is the complete body.- Specified by:
getBodyin interfaceHttpPackage.TransferDecodingLayerInterface- Returns:
- Accumulated body.
-
-