Package com.teamdev.jxbrowser.net
Interface ByteData
- All Superinterfaces:
UploadData
An upload data as a sequence of bytes.
-
Method Summary
Modifier and TypeMethodDescriptiondefault byte[]bytes()Returns an array containing the upload data bytes of the associated URL request.default ContentTypeReturns the content type of this upload data as specified in theContent-Typeheader.static ByteDataof(byte[] data) Creates an instance ofByteDatawith the given upload data bytes.static ByteDataof(byte[] data, ContentType contentType) Creates an instance ofByteDatawith the given upload data bytes and content type.static ByteDataCreates an instance ofByteDatawith the given upload data bytes.static ByteDataof(String data, ContentType contentType) Creates an instance ofByteDatawith the given upload data bytes and content type.
-
Method Details
-
of
Creates an instance ofByteDatawith the given upload data bytes.The bytes are retrieved from the
datastring using theString.getBytes(Charset)method with the UTF-8 charset. -
of
Creates an instance ofByteDatawith the given upload data bytes. -
of
Creates an instance ofByteDatawith the given upload data bytes and content type.The bytes are retrieved from the
datastring using theString.getBytes(Charset)method with the UTF-8 charset.- Since:
- 7.33
-
of
Creates an instance ofByteDatawith the given upload data bytes and content type.- Since:
- 7.33
-
bytes
default byte[] bytes()Description copied from interface:UploadDataReturns an array containing the upload data bytes of the associated URL request.If the upload data is constructed manually and is not associated with a URL request, returns an empty array.
- Specified by:
bytesin interfaceUploadData
-
contentType
Description copied from interface:UploadDataReturns the content type of this upload data as specified in theContent-Typeheader.If the upload data is constructed manually, the
Content-Typeheader will be created after it is passed to the Chromium engine. Thus, the returnedContentTypeobject will not contain meaningful values in this case.- Specified by:
contentTypein interfaceUploadData
-