public class ByteArrayUploadable extends java.lang.Object implements Uploadable<byte[]>
byte array.| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
byteArray |
protected java.lang.String |
fileName |
protected java.lang.String |
mimeType |
| Constructor and Description |
|---|
ByteArrayUploadable(byte[] byteArray,
java.lang.String fileName) |
ByteArrayUploadable(byte[] byteArray,
java.lang.String fileName,
java.lang.String mimeType) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes()
Returns content bytes.
|
byte[] |
getContent()
Returns the original content.
|
java.lang.String |
getFileName()
Returns content file name.
|
java.lang.String |
getMimeType()
Returns MIME type.
|
int |
getSize()
Returns size in bytes.
|
java.io.InputStream |
openInputStream()
Opens
InputStream. |
protected final byte[] byteArray
protected final java.lang.String fileName
protected final java.lang.String mimeType
public ByteArrayUploadable(byte[] byteArray,
java.lang.String fileName)
public ByteArrayUploadable(byte[] byteArray,
java.lang.String fileName,
java.lang.String mimeType)
public byte[] getContent()
UploadablegetContent in interface Uploadable<byte[]>public byte[] getBytes()
UploadablegetBytes in interface Uploadable<byte[]>public java.lang.String getFileName()
Uploadablenull, the field's name will be used.getFileName in interface Uploadable<byte[]>public java.lang.String getMimeType()
Uploadablenull,
MIME type will be determined from
file name's extension.getMimeType in interface Uploadable<byte[]>public int getSize()
UploadablegetSize in interface Uploadable<byte[]>public java.io.InputStream openInputStream()
UploadableInputStream. User is responsible
for closing it.openInputStream in interface Uploadable<byte[]>Copyright © 2003-present Jodd Team