public class UploadFile extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<UploadFile> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
byte[] |
getMultipartHeader(boolean isUtf8)
Gets the HTTP/Multipart header for this file.
|
InputStream |
getStream()
Gets the
InputStream to read the content of this file. |
long |
getTotalMultipartBytes(long boundaryBytesLength,
boolean isUtf8)
Get the total number of bytes needed by this file in the HTTP/Multipart request, considering
that to send each file there is some overhead due to some bytes needed for the boundary
and some bytes needed for the multipart headers
|
long |
length()
Gets the file length in bytes.
|
void |
writeToParcel(Parcel parcel,
int arg1) |
public static final Parcelable.Creator<UploadFile> CREATOR
public long length()
public final InputStream getStream() throws FileNotFoundException
InputStream
to read the content of this file.FileNotFoundException
- if the file can't be found at the path specified in the
constructorpublic byte[] getMultipartHeader(boolean isUtf8) throws UnsupportedEncodingException
isUtf8
- true to get the multipart header in UTF-8 charset, false to use US-ASCIIUnsupportedEncodingException
- if the device does not support the selected encodingpublic long getTotalMultipartBytes(long boundaryBytesLength, boolean isUtf8) throws UnsupportedEncodingException
boundaryBytesLength
- length in bytes of the multipart boundaryisUtf8
- true to get the multipart header in UTF-8 charset, false to use US-ASCIIUnsupportedEncodingException
- if the device does not support the selected encodingpublic void writeToParcel(Parcel parcel, int arg1)
writeToParcel
in interface Parcelable
public int describeContents()
describeContents
in interface Parcelable