Class TemporaryBufferEntity
java.lang.Object
org.apache.http.entity.AbstractHttpEntity
org.eclipse.jgit.transport.http.apache.TemporaryBufferEntity
- All Implemented Interfaces:
AutoCloseable
,org.apache.http.HttpEntity
public class TemporaryBufferEntity
extends org.apache.http.entity.AbstractHttpEntity
implements AutoCloseable
A
HttpEntity
which takes its content from a
TemporaryBuffer
- Since:
- 3.3
-
Field Summary
FieldsFields inherited from class org.apache.http.entity.AbstractHttpEntity
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionTemporaryBufferEntity
(TemporaryBuffer buffer) Construct a newHttpEntity
which will contain the content stored in the specified buffer -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close destroys the associated buffer used to buffer the entityGet thebuffer
containing the contentlong
boolean
boolean
void
setContentLength
(int contentLength) Set thecontentLength
void
writeTo
(OutputStream outstream) Methods inherited from class org.apache.http.entity.AbstractHttpEntity
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType, toString
-
Field Details
-
buffer
-
contentLength
-
-
Constructor Details
-
TemporaryBufferEntity
Construct a newHttpEntity
which will contain the content stored in the specified buffer- Parameters:
buffer
-
-
-
Method Details
-
getBuffer
Get thebuffer
containing the content- Returns:
- buffer containing the content
-
isRepeatable
public boolean isRepeatable()- Specified by:
isRepeatable
in interfaceorg.apache.http.HttpEntity
-
getContentLength
public long getContentLength()- Specified by:
getContentLength
in interfaceorg.apache.http.HttpEntity
-
getContent
- Specified by:
getContent
in interfaceorg.apache.http.HttpEntity
- Throws:
IOException
IllegalStateException
-
writeTo
- Specified by:
writeTo
in interfaceorg.apache.http.HttpEntity
- Throws:
IOException
-
isStreaming
public boolean isStreaming()- Specified by:
isStreaming
in interfaceorg.apache.http.HttpEntity
-
setContentLength
public void setContentLength(int contentLength) Set thecontentLength
- Parameters:
contentLength
-
-
close
public void close()Close destroys the associated buffer used to buffer the entity- Specified by:
close
in interfaceAutoCloseable
- Since:
- 4.5
-