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

namespace clucene.net {

using System;
using System.Runtime.InteropServices;

public class RAMOutputStream : OutputStream {
  private HandleRef swigCPtr;

  internal RAMOutputStream(IntPtr cPtr, bool cMemoryOwn) : base(libCLcsharpPINVOKE.RAMOutputStreamUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

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

  ~RAMOutputStream() {
    Dispose();
  }

  public override void Dispose() {
    if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
      swigCMemOwn = false;
      libCLcsharpPINVOKE.delete_RAMOutputStream(swigCPtr);
    }
    swigCPtr = new HandleRef(null, IntPtr.Zero);
    GC.SuppressFinalize(this);
    base.Dispose();
  }

  public void reset() {
    libCLcsharpPINVOKE.RAMOutputStream_reset(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public void writeTo(OutputStream output) {
    libCLcsharpPINVOKE.RAMOutputStream_writeTo(swigCPtr, OutputStream.getCPtr(output));
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

}

}
