public interface ByteArrayEncoder
bae.append(a).appendFileProperty(b, c).append(d);
FileUploadThreadHTTP
Modifier and Type | Method and Description |
---|---|
ByteArrayEncoder |
append(byte[] b)
Append a stream, to be encoded at the current end of the byte array.
|
ByteArrayEncoder |
append(ByteArrayEncoder bae)
Append a string, to be encoded at the current end of the byte array.
|
ByteArrayEncoder |
append(int b)
Append a byte, to be encoded at the current end of the byte array. he
byte to be written is the eight low-order bits of the argument b.
|
ByteArrayEncoder |
append(String str)
Append a string, to be encoded at the current end of the byte array.
|
ByteArrayEncoder |
appendEndPropertyList()
Finish a property list.
|
ByteArrayEncoder |
appendFormVariables(String formname)
Add to the current encoder all properties contained in the given HTML
form.
|
ByteArrayEncoder |
appendTextProperty(String name,
String value,
int index)
Append a property, name and value.
|
void |
close()
Closes the encoding writer, and prepares the encoded length and byte
array.
|
String |
getBoundary()
Gets the HTTP boundary, that separate the form variables.
|
byte[] |
getEncodedByteArray()
Get the encoded result.
|
int |
getEncodedLength()
Get the length of the encoded result.
|
String |
getEncoding() |
String |
getString()
Get the String that matches the encoded result.
|
boolean |
isClosed() |
void close() throws JUploadIOException
getEncodedLength()
and getEncodedByteArray()
.
Note: After a call to this method, you can not append any new data
to the encoder.JUploadIOException
- Encapsulates any IO ExceptionByteArrayEncoder append(String str) throws JUploadIOException
str
- The string to append and encode.JUploadIOException
ByteArrayEncoder append(int b) throws JUploadIOException
b
- Writes the specified byte to this output stream.JUploadIOException
ByteArrayEncoder append(byte[] b) throws JUploadIOException
b
- JUploadIOException
ByteArrayEncoder appendTextProperty(String name, String value, int index) throws JUploadIOException
appendEndPropertyList()
, to properly finish the property list.
In HTTP mode, it will add the last boundary, at a specific format.name
- Name of the property to be addedvalue
- Value of this property for the current file. It's up to the
caller to call this method at the right time.index
- Index of the file concerned by this value. -1 if this is a
global parameter.JUploadIOException
appendEndPropertyList()
ByteArrayEncoder appendEndPropertyList() throws JUploadIOException
JUploadIOException
ByteArrayEncoder appendFormVariables(String formname) throws JUploadIOException
appendTextProperty(String, String, int)
.formname
- The HTML form name. This method will get the data from
this form, by using the JUploadContext.getApplet()
method.JUploadIOException
ByteArrayEncoder append(ByteArrayEncoder bae) throws JUploadIOException
bae
- The ByteArrayEncoder whose encoding result should be appended
to the current encoder. bae must be closed, before being
appended.JUploadIOException
- This exception is thrown when this method is
called on a non-closed encoder.boolean isClosed()
String getBoundary()
String getEncoding()
int getEncodedLength() throws JUploadIOException
JUploadIOException
- This exception is thrown when this method is
called on a non-closed encoder.byte[] getEncodedByteArray() throws JUploadIOException
JUploadIOException
- This exception is thrown when this method is
called on a non-closed encoder.String getString() throws JUploadIOException
JUploadIOException
- This exception is thrown when this method is
called on a non-closed encoder.Copyright © 2015. All rights reserved.