public class ByteArrayPartSource extends Object implements PartSource
Constructor and Description |
---|
ByteArrayPartSource(String fileName,
byte[] bytes)
Constructor for ByteArrayPartSource.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
createInputStream()
Gets a new InputStream for reading this source.
|
String |
getFileName()
Gets the name of the file this source represents.
|
long |
getLength()
Gets the number of bytes contained in this source.
|
public ByteArrayPartSource(String fileName, byte[] bytes)
fileName
- the name of the file these bytes representbytes
- the content of this partpublic long getLength()
PartSource
getLength
in interface PartSource
PartSource.getLength()
public String getFileName()
PartSource
getFileName
in interface PartSource
PartSource.getFileName()
public InputStream createInputStream() throws IOException
PartSource
createInputStream
in interface PartSource
IOException
- if an error occurs when creating the InputStreamPartSource.createInputStream()
Copyright © 2015. All rights reserved.