com.koushikdutta.async.http.StringPart Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of androidasync Show documentation
Show all versions of androidasync Show documentation
Asynchronous socket, http(s) (client+server) and websocket library for android. Based on nio, not threads.
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());
}
}