im.yixin.sdk.http.multipart
类 ByteArrayPartSource

java.lang.Object
  继承者 im.yixin.sdk.http.multipart.ByteArrayPartSource
所有已实现的接口:
PartSource

public class ByteArrayPartSource
extends java.lang.Object
implements PartSource

A PartSource that reads from a byte array. This class should be used when the data to post is already loaded into memory.

从以下版本开始:
2.0

构造方法摘要
ByteArrayPartSource(java.lang.String fileName, byte[] bytes)
          Constructor for ByteArrayPartSource.
 
方法摘要
 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.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ByteArrayPartSource

public ByteArrayPartSource(java.lang.String fileName,
                           byte[] bytes)
Constructor for ByteArrayPartSource.

参数:
fileName - the name of the file these bytes represent
bytes - the content of this part
方法详细信息

getLength

public long getLength()
从接口 PartSource 复制的描述
Gets the number of bytes contained in this source.

指定者:
接口 PartSource 中的 getLength
返回:
a value >= 0
另请参见:
PartSource.getLength()

getFileName

public java.lang.String getFileName()
从接口 PartSource 复制的描述
Gets the name of the file this source represents.

指定者:
接口 PartSource 中的 getFileName
返回:
the fileName used for posting a MultiPart file part
另请参见:
PartSource.getFileName()

createInputStream

public java.io.InputStream createInputStream()
从接口 PartSource 复制的描述
Gets a new InputStream for reading this source. This method can be called more than once and should therefore return a new stream every time.

指定者:
接口 PartSource 中的 createInputStream
返回:
a new InputStream
另请参见:
PartSource.createInputStream()