/*
 * Copyright 2012-2013 Continuuity,Inc. All Rights Reserved.
 */
package com.continuuity.gateway.v2.handlers.v2;

import com.ning.http.client.Request;
import org.jboss.netty.buffer.ChannelBuffer;

import java.io.IOException;
import java.io.OutputStream;

/**
 *
 */
public final class ChannelBufferEntityWriter implements Request.EntityWriter {

  private final ChannelBuffer buffer;

  public ChannelBufferEntityWriter(ChannelBuffer buffer) {
    this.buffer = buffer;
  }

  @Override
  public void writeEntity(OutputStream out) throws IOException {
    buffer.readBytes(out, buffer.readableBytes());
  }
}

@@ -257,16 +257,124 @@
 %0A%0A/**%0A *
+ An implementation of %7B@link Request.EntityWriter%7D for sending request body from%0A * a %7B@link ChannelBuffer%7D.
 %0A */%0Apub

Add comment.