Package org.apache.http.nio
Interface ContentEncoder
-
- All Known Subinterfaces:
FileContentEncoder
- All Known Implementing Classes:
AbstractContentEncoder,ChunkEncoder,IdentityEncoder,LengthDelimitedEncoder
public interface ContentEncoderAbstract HTTP content encoder. HTTP content encoders can be used to apply the required coding transformation and write entity content to the underlying channel in small chunks.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcomplete()Terminates the content stream.booleanisCompleted()Returnstrueif the entity has been transferred in its entirety.intwrite(java.nio.ByteBuffer src)Writes a portion of entity content to the underlying channel.
-
-
-
Method Detail
-
write
int write(java.nio.ByteBuffer src) throws java.io.IOException
Writes a portion of entity content to the underlying channel.- Parameters:
src- The buffer from which content is to be retrieved- Returns:
- The number of bytes read, possibly zero
- Throws:
java.io.IOException- if I/O error occurs while writing content
-
complete
void complete() throws java.io.IOExceptionTerminates the content stream.- Throws:
java.io.IOException- if I/O error occurs while writing content
-
isCompleted
boolean isCompleted()
Returnstrueif the entity has been transferred in its entirety.- Returns:
trueif all the content has been produced,falseotherwise.
-
-