InputStreamPartSource.java :  » REST » kyte-api-java » com » kyte » api » util » Java Open Source

Java Open Source » REST » kyte api java 
kyte api java » com » kyte » api » util » InputStreamPartSource.java
package com.kyte.api.util;

import org.apache.commons.httpclient.methods.multipart.PartSource;

import java.io.InputStream;
import java.io.IOException;

/**
 *
 */
public class InputStreamPartSource implements PartSource
{
    private InputStream inputStream;
    private long dataLength;
    private String fileName;

    public InputStreamPartSource(InputStream inputStream, long dataLength, String fileName)
    {
        this.inputStream = inputStream;
        this.dataLength = dataLength;
        this.fileName = fileName;
    }

    public long getLength()
    {
        return dataLength;
    }

    public String getFileName()
    {
        return fileName;
    }

    public InputStream createInputStream() throws IOException
    {
        return inputStream;
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.