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


Class name: BufferStream extends: UnitGenerator fields: swigCPtrForBufferStream {

  Method [ pvtSetCPtr: newCPtr memoryOwn: newCMemoryOwn
    super pvtSetCPtr: (CslNI cslNI_SWIGBufferStreamToUnitGenerator: newCPtr) memoryOwn: newCMemoryOwn.
    swigCPtrForBufferStream := newCPtr.
  ]

  Method [ getCPtrForBufferStream
    ^swigCPtrForBufferStream
  ]


  Function [ new
    self noDefaultConstructorError
  ]

  Method[ swigFinalize
    super swigFinalize.
    self delete.
  ]

  Method [ delete 
    (swigCMemoryOwn and:[ swigCPtrForBufferStream ~~ 0 ]) ifTrue:[
      swigCMemoryOwn := false.
      CslNI cslNI_delete_BufferStream: swigCPtrForBufferStream.
    ].
    swigCPtrForBufferStream := 0.
    super delete.
  ]

  Function[ getCPtr: obj
     obj isNil ifTrue:[^0].
     ^obj getCPtrForBufferStream
  ]

  Function [ buffer: buffer
    ^self fromPointer: (CslNI cslNI_new_BufferStream: (Buffer getCPtr: buffer)) memoryOwn: true
  ]

  Method [ nextBuffer: outputBuffer 
    CslNI cslNI_BufferStream_nextBuffer__SWIG_0: swigCPtrForBufferStream with: (Buffer getCPtr: outputBuffer)
  ]

  Method [ writeBuffer: inputBuffer 
    CslNI cslNI_BufferStream_writeBuffer__SWIG_0: swigCPtrForBufferStream with: (Buffer getCPtr: inputBuffer)
  ]

  Method [ nextBuffer: outputBuffer outBufNum: outBufNum 
    CslNI cslNI_BufferStream_nextBuffer__SWIG_1: swigCPtrForBufferStream with: (Buffer getCPtr: outputBuffer) with: outBufNum
  ]

  Method [ writeBuffer: inputBuffer bufNum: bufNum 
    CslNI cslNI_BufferStream_writeBuffer__SWIG_1: swigCPtrForBufferStream with: (Buffer getCPtr: inputBuffer) with: bufNum
  ]

  Method [ setBuffer: buffer 
    CslNI cslNI_BufferStream_setBuffer: swigCPtrForBufferStream with: (Buffer getCPtr: buffer)
  ]

  Method [ seekTo: position whence: whence 
    ^CslNI cslNI_BufferStream_seekTo: swigCPtrForBufferStream with: position with: whence
  ]

  Method [ duration 
    ^CslNI cslNI_BufferStream_duration: swigCPtrForBufferStream 
  ]

}
