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[]
boundary
protected static byte[]
CRLF_BYTES
Carriage return/linefeed as a byte arrayprotected static byte[]
EXTRA_BYTES
Extra characters as a byte arrayprotected T
part
protected MultipartState
state
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
protected io.netty.buffer.ByteBuf
computePostContentBytes(int postContentLength)
protected int
computePostContentLength()
protected io.netty.buffer.ByteBuf
computePreContentBytes(int preContentLength)
protected int
computePreContentLength()
protected abstract long
getContentLength()
MultipartState
getState()
boolean
isTargetSlow()
long
length()
protected long
transfer(io.netty.buffer.ByteBuf source, io.netty.buffer.ByteBuf target, MultipartState sourceFullyWrittenState)
protected long
transfer(io.netty.buffer.ByteBuf source, WritableByteChannel target, MultipartState sourceFullyWrittenState)
protected abstract long
transferContentTo(io.netty.buffer.ByteBuf target)
protected abstract long
transferContentTo(WritableByteChannel target)
long
transferTo(io.netty.buffer.ByteBuf target)
long
transferTo(WritableByteChannel target)
protected void
visitContentIdHeader(PartVisitor visitor)
protected void
visitContentTypeHeader(PartVisitor visitor)
protected void
visitCustomHeaders(PartVisitor visitor)
protected void
visitDispositionHeader(PartVisitor visitor)
protected void
visitEndOfHeaders(PartVisitor visitor)
protected void
visitPostContent(PartVisitor visitor)
protected void
visitPreContent(PartVisitor visitor)
protected void
visitStart(PartVisitor visitor)
protected void
visitTransferEncodingHeader(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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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)
-
-