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

microsoft.exchange.webservices.data.ByteArrayOSRequestEntity Maven / Gradle / Ivy

Go to download

The source came from http://archive.msdn.microsoft.com/ewsjavaapi Support for Maven has been added.

There is a newer version: 1.1.5.2
Show newest version
/**************************************************************************
 * copyright file="ByteArrayOSRequestEntity.java" company="Microsoft"
 *     Copyright (c) Microsoft Corporation.  All rights reserved.
 * 
 * Defines the ByteArrayOSRequestEntity.java.
 **************************************************************************/
package microsoft.exchange.webservices.data;

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

import org.apache.commons.httpclient.methods.RequestEntity;

class ByteArrayOSRequestEntity implements RequestEntity{

	private ByteArrayOutputStream os = null;
	
	/**
	 * Constructor for ByteArrayOSRequestEntity.
	 */
	ByteArrayOSRequestEntity(OutputStream os) {
		super();
		this.os = (ByteArrayOutputStream) os;
	}
	
	@Override
	public long getContentLength() {
		return os.size();
	}

	@Override
	public String getContentType() {
		return "text/xml; charset=utf-8";
	}

	@Override
	public boolean isRepeatable() {
		return true;
	}

	@Override
	public void writeRequest(OutputStream out) throws IOException {
		os.writeTo(out);		
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy