|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ByteArrayEncoder
This interface contains all technical methods to encode data, into a given
character encoding. This is especially useful to encode the HTTP output to
the server.
Each appendXxxx method returns the current instance. This allows easy
concatanation of calls to this class. For instance:
bae.append(a).appendFileProperty(b, c).append(d);
FileUploadThreadHTTP| Method Summary | |
|---|---|
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(java.lang.String str)
Append a string, to be encoded at the current end of the byte array. |
ByteArrayEncoder |
appendFileProperty(java.lang.String name,
java.lang.String value)
Append a property, name and value. |
ByteArrayEncoder |
appendFormVariables(java.lang.String formname)
Add to the current encoder all properties contained in the given HTML form. |
void |
close()
Closes the encoding writer, and prepares the encoded length and byte array. |
byte[] |
getEncodedByteArray()
Get the encoded result. |
int |
getEncodedLength()
Get the length of the encoded result. |
java.lang.String |
getEncoding()
|
java.lang.String |
getString()
Get the String that matches the encoded result. |
boolean |
isClosed()
|
| Method Detail |
|---|
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 Exception
ByteArrayEncoder append(java.lang.String str)
throws JUploadIOException
str - The string to append and encode.
JUploadIOException
ByteArrayEncoder append(byte[] b)
throws JUploadIOException
b -
JUploadIOException
ByteArrayEncoder appendFileProperty(java.lang.String name,
java.lang.String value)
throws JUploadIOException
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.
JUploadIOException
ByteArrayEncoder appendFormVariables(java.lang.String formname)
throws JUploadIOException
formname - The HTML form name. This method will get the data from
this form, by using the UploadPolicy.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()
java.lang.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.
java.lang.String getString()
throws JUploadIOException
JUploadIOException - This exception is thrown when this method is
called on a non-closed encoder.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||