List of usage examples for org.apache.commons.httpclient HttpConnection write
public void write(byte[] data) throws IOException, IllegalStateException
From source file:org.woodwardbernsteinprotocol.protocol.DirectTransfer.java
@Override public void transmit(Tip tip) throws IOException { ByteArrayOutputStream data = new ByteArrayOutputStream(); Base64OutputStream stream = new Base64OutputStream(data); tip.transmit(stream);/*from w ww.j av a 2 s . co m*/ InputStream writer = new ByteArrayInputStream(data.toByteArray()); HttpConnection client = new HttpConnection(config); client.open(); byte[] buffer = new byte[10240]; int read = 0; byte[] start = new byte[] { 't', 'i', 'p', '=' }; client.write(start); while ((read = writer.read(buffer, 0, 10240)) > 0) { client.write(buffer, 0, read); } client.close(); }