Class MultipartPart<T extends PartBase>
- java.lang.Object
-
- org.asynchttpclient.request.body.multipart.part.MultipartPart<T>
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
FileLikeMultipartPart,MessageEndMultipartPart,StringMultipartPart
public abstract class MultipartPart<T extends PartBase> extends Object implements Closeable
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]boundaryprotected static byte[]CRLF_BYTESCarriage return/linefeed as a byte arrayprotected static byte[]EXTRA_BYTESExtra characters as a byte arrayprotected Tpartprotected MultipartStatestate
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected io.netty.buffer.ByteBufcomputePostContentBytes(int postContentLength)protected intcomputePostContentLength()protected io.netty.buffer.ByteBufcomputePreContentBytes(int preContentLength)protected intcomputePreContentLength()protected abstract longgetContentLength()MultipartStategetState()booleanisTargetSlow()longlength()protected longtransfer(io.netty.buffer.ByteBuf source, io.netty.buffer.ByteBuf target, MultipartState sourceFullyWrittenState)protected longtransfer(io.netty.buffer.ByteBuf source, WritableByteChannel target, MultipartState sourceFullyWrittenState)protected abstract longtransferContentTo(io.netty.buffer.ByteBuf target)protected abstract longtransferContentTo(WritableByteChannel target)longtransferTo(io.netty.buffer.ByteBuf target)longtransferTo(WritableByteChannel target)protected voidvisitContentIdHeader(PartVisitor visitor)protected voidvisitContentTypeHeader(PartVisitor visitor)protected voidvisitCustomHeaders(PartVisitor visitor)protected voidvisitDispositionHeader(PartVisitor visitor)protected voidvisitEndOfHeaders(PartVisitor visitor)protected voidvisitPostContent(PartVisitor visitor)protected voidvisitPreContent(PartVisitor visitor)protected voidvisitStart(PartVisitor visitor)protected voidvisitTransferEncodingHeader(PartVisitor visitor)
-
-
-
Field Detail
-
CRLF_BYTES
protected static final byte[] CRLF_BYTES
Carriage return/linefeed as a byte array
-
EXTRA_BYTES
protected static final byte[] EXTRA_BYTES
Extra characters as a byte array
-
boundary
protected final byte[] boundary
-
state
protected MultipartState state
-
-
Method Detail
-
length
public long length()
-
getState
public MultipartState getState()
-
isTargetSlow
public boolean isTargetSlow()
-
transferTo
public long transferTo(io.netty.buffer.ByteBuf target) throws IOException- Throws:
IOException
-
transferTo
public long transferTo(WritableByteChannel target) throws IOException
- Throws:
IOException
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getContentLength
protected abstract long getContentLength()
-
transferContentTo
protected abstract long transferContentTo(io.netty.buffer.ByteBuf target) throws IOException- Throws:
IOException
-
transferContentTo
protected abstract long transferContentTo(WritableByteChannel target) throws IOException
- Throws:
IOException
-
transfer
protected long transfer(io.netty.buffer.ByteBuf source, io.netty.buffer.ByteBuf target, MultipartState sourceFullyWrittenState)
-
transfer
protected long transfer(io.netty.buffer.ByteBuf source, WritableByteChannel target, MultipartState sourceFullyWrittenState) throws IOException- Throws:
IOException
-
computePreContentLength
protected int computePreContentLength()
-
computePreContentBytes
protected io.netty.buffer.ByteBuf computePreContentBytes(int preContentLength)
-
computePostContentLength
protected int computePostContentLength()
-
computePostContentBytes
protected io.netty.buffer.ByteBuf computePostContentBytes(int postContentLength)
-
visitStart
protected void visitStart(PartVisitor visitor)
-
visitDispositionHeader
protected void visitDispositionHeader(PartVisitor visitor)
-
visitContentTypeHeader
protected void visitContentTypeHeader(PartVisitor visitor)
-
visitTransferEncodingHeader
protected void visitTransferEncodingHeader(PartVisitor visitor)
-
visitContentIdHeader
protected void visitContentIdHeader(PartVisitor visitor)
-
visitCustomHeaders
protected void visitCustomHeaders(PartVisitor visitor)
-
visitEndOfHeaders
protected void visitEndOfHeaders(PartVisitor visitor)
-
visitPreContent
protected void visitPreContent(PartVisitor visitor)
-
visitPostContent
protected void visitPostContent(PartVisitor visitor)
-
-