All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.koushikdutta.async.http.StringPart Maven / Gradle / Ivy

Go to download

Asynchronous socket, http(s) (client+server) and websocket library for android. Based on nio, not threads.

There is a newer version: 3.1.0
Show newest version
package com.koushikdutta.async.http;

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

public class StringPart extends StreamPart {
    String value;
    public StringPart(String name, String value) {
        super(name, value.getBytes().length, null);
        this.value = value;
    }

    @Override
    protected InputStream getInputStream() throws IOException {
        return new ByteArrayInputStream(value.getBytes());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy