public class ByteArrayPartSource extends java.lang.Object implements PartSource
Constructor and Description |
---|
ByteArrayPartSource(java.lang.String fileName,
byte[] bytes)
Constructor for ByteArrayPartSource.
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
createInputStream()
Gets a new InputStream for reading this source.
|
java.lang.String |
getFileName()
Gets the name of the file this source represents.
|
long |
getLength()
Gets the number of bytes contained in this source.
|
public ByteArrayPartSource(java.lang.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 java.lang.String getFileName()
PartSource
getFileName
in interface PartSource
PartSource.getFileName()
public java.io.InputStream createInputStream() throws java.io.IOException
PartSource
createInputStream
in interface PartSource
java.io.IOException
- if an error occurs when creating the InputStreamPartSource.createInputStream()
Copyright © 2001-2012 Apache Software Foundation. All Rights Reserved.