Ejemplo n.º 1
0
    public BBaseOpcodeHandler GetOpcodeHandler(int which)
    {
        IntPtr             cPtr = HCSSTREAMPINVOKE.BStreamFileToolkit_GetOpcodeHandler(swigCPtr, which);
        BBaseOpcodeHandler ret  = (cPtr == IntPtr.Zero) ? null : new BBaseOpcodeHandler(cPtr, false);

        return(ret);
    }
Ejemplo n.º 2
0
    static void WriteObject
    (
        BBaseOpcodeHandler handler,
        BStreamFileToolkit tk,
        BinaryWriter wb,
        byte[] buffer,
        int size
    )
    {
        // ask the toolkit to write out the object; the toolkit will write out as much as
        // the current buffer can hold
        TK_Status status = handler.Write(tk);

        // if there is still more data left to write; we have to loop through
        // generating and writing buffers of data until we're done
        while (status == TK_Status.TK_Pending)
        {
            // due to compression, preparing a new buffer might immediately fill that buffer
            // so we need an extra check to possibly export that buffer and prepare a new buffer
            while (status == TK_Status.TK_Pending)
            {
                // ask the toolkit how much of the buffer is currently filled
                // this will normally be the same as the buffer size that we passed in
                int count = tk.CurrentBufferLength();

                // write the current out to our file since this example deals with
                // exporting a file; however, instead of writing to a file, the buffer of
                // data could be sent to an application data-structure, or transmitted
                // over a network ('streamed'), etc...
                // fwrite(buffer, sizeof (char), count, fp);
                wb.Write(buffer);

                // tell the toolkit where it can resume writing data; in this case, we
                // can reuse the same buffer once we're done with it
                status = tk.PrepareBuffer(buffer, size);
            }

            // ask the toolkit to continue trying to write out the object's data
            status = handler.Write(tk);
        }
    }
Ejemplo n.º 3
0
 public void SetPostwalkHandler(BBaseOpcodeHandler handler)
 {
     HCSSTREAMPINVOKE.BStreamFileToolkit_SetPostwalkHandler(swigCPtr, BBaseOpcodeHandler.getCPtr(handler));
 }
Ejemplo n.º 4
0
 public void SetOpcodeHandler(int which, BBaseOpcodeHandler handler)
 {
     HCSSTREAMPINVOKE.BStreamFileToolkit_SetOpcodeHandler(swigCPtr, which, BBaseOpcodeHandler.getCPtr(handler));
 }
Ejemplo n.º 5
0
 internal static HandleRef getCPtr(BBaseOpcodeHandler obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Ejemplo n.º 6
0
 public void SetThumbnail(BBaseOpcodeHandler handler)
 {
     HCSSTREAMPINVOKE.HStreamFileToolkit_SetThumbnail__SWIG_0(swigCPtr, BBaseOpcodeHandler.getCPtr(handler));
 }