/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.35
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace FreeSWITCH.Native {

using System;
using System.Runtime.InteropServices;

public partial class Stream : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal Stream(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(Stream obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~Stream() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        freeswitchPINVOKE.delete_Stream(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
    }
  }

  public Stream() : this(freeswitchPINVOKE.new_Stream__SWIG_0(), true) {
  }

  public Stream(switch_stream_handle arg0) : this(freeswitchPINVOKE.new_Stream__SWIG_1(switch_stream_handle.getCPtr(arg0)), true) {
  }

  public void Write(string data) {
    freeswitchPINVOKE.Stream_Write(swigCPtr, data);
  }

  public string get_data() {
    string ret = freeswitchPINVOKE.Stream_get_data(swigCPtr);
    return ret;
  }

}

}
