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()
Uploadable
getContent
in interface Uploadable<byte[]>
public byte[] getBytes()
Uploadable
getBytes
in interface Uploadable<byte[]>
public java.lang.String getFileName()
Uploadable
null
, the field's name will be used.getFileName
in interface Uploadable<byte[]>
public java.lang.String getMimeType()
Uploadable
null
,
MIME type will be determined from
file name's
extension.getMimeType
in interface Uploadable<byte[]>
public int getSize()
Uploadable
getSize
in interface Uploadable<byte[]>
public java.io.InputStream openInputStream()
Uploadable
InputStream
. User is responsible
for closing it.openInputStream
in interface Uploadable<byte[]>
Copyright © 2003-present Jodd Team