FileDocCategorySizeDatePackage
ByteArrayPartSource.javaAPI DocAndroid 1.5 API2745Wed May 06 22:41:56 BST 2009com.android.internal.http.multipart

ByteArrayPartSource

public class ByteArrayPartSource extends 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.
author
Michael Becke
since
2.0

Fields Summary
private String
fileName
Name of the source file.
private byte[]
bytes
Byte array of the source file.
Constructors Summary
public ByteArrayPartSource(String fileName, byte[] bytes)
Constructor for ByteArrayPartSource.

param
fileName the name of the file these bytes represent
param
bytes the content of this part


        this.fileName = fileName;
        this.bytes = bytes;

    
Methods Summary
public java.io.InputStreamcreateInputStream()

see
PartSource#createInputStream()

        return new ByteArrayInputStream(bytes);
    
public java.lang.StringgetFileName()

see
PartSource#getFileName()

        return fileName;
    
public longgetLength()

see
PartSource#getLength()

        return bytes.length;