Package com.ning.http.client.multipart
Class StringPart
java.lang.Object
com.ning.http.client.multipart.PartBase
com.ning.http.client.multipart.StringPart
- All Implemented Interfaces:
Part
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CharsetDefault charset of string parametersstatic final StringDefault content encoding of string parameters.static final StringDefault transfer encoding of string parametersFields inherited from class com.ning.http.client.multipart.PartBase
AHC_ALLOW_UTF8, HEADERS_CHARSETFields inherited from interface com.ning.http.client.multipart.Part
CHARSET_BYTES, CONTENT_DISPOSITION_BYTES, CONTENT_ID_BYTES, CONTENT_TRANSFER_ENCODING_BYTES, CONTENT_TYPE_BYTES, CRLF_BYTES, EXTRA_BYTES, FORM_DATA_DISPOSITION_TYPE_BYTES, NAME_BYTES, QUOTE_BYTE -
Constructor Summary
ConstructorsConstructorDescriptionStringPart(String name, String value) StringPart(String name, String value, String contentType) StringPart(String name, String value, String contentType, Charset charset) StringPart(String name, String value, String contentType, Charset charset, String contentId, String transferEncoding) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes(byte[] boundary) protected longReturn the length of the data.getValue()protected voidsendData(OutputStream out) Writes the data to the given OutputStream.longwrite(WritableByteChannel target, byte[] boundary) Methods inherited from class com.ning.http.client.multipart.PartBase
addCustomHeader, getCharset, getContentId, getContentType, getDispositionType, getName, getTransferEncoding, length, setCustomHeaders, setDispositionType, toString, visitContentIdHeader, visitContentTypeHeader, visitCustomHeaders, visitDispositionHeader, visitEnd, visitEndOfHeaders, visitStart, visitTransferEncodingHeader, write
-
Field Details
-
DEFAULT_CONTENT_TYPE
Default content encoding of string parameters.- See Also:
-
DEFAULT_CHARSET
Default charset of string parameters -
DEFAULT_TRANSFER_ENCODING
Default transfer encoding of string parameters- See Also:
-
-
Constructor Details
-
StringPart
-
StringPart
-
StringPart
-
StringPart
-
StringPart
-
-
Method Details
-
sendData
Writes the data to the given OutputStream.- Specified by:
sendDatain classPartBase- Parameters:
out- the OutputStream to write to- Throws:
IOException- if there is a write error
-
getDataLength
protected long getDataLength()Return the length of the data.- Specified by:
getDataLengthin classPartBase- Returns:
- The length of the data.
-
getBytes
- Throws:
IOException
-
write
- Throws:
IOException
-
getValue
-