Discuss this help topic in SecureBlackbox Forum

TElPGPWriter.OnTemporaryStream

TElPGPWriter     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


This event is fired when temporary stream is needed.

Declaration

[C#]
    event TSBPGPTemporaryStreamEvent OnTemporaryStream;
    delegate void TSBPGPTemporaryStreamEvent(Object Sender, ref System.IO.Stream Stream, ref bool FreeOnFinish);

[VB.NET]
    Event OnTemporaryStream As TSBPGPTemporaryStreamEvent
    Delegate Sub TSBPGPTemporaryStreamEvent(ByVal Sender As Object, ByRef Stream As System.IO.Stream, ByRef FreeOnFinish As Boolean)

[Pascal]
    property OnTemporaryStream : TSBPGPTemporaryStreamEvent;
    TSBPGPTemporaryStreamEvent = procedure(Sender: TObject; var Stream: TStream; var FreeOnFinish: boolean) of object;

[C++]
    void get_OnTemporaryStream(TSBPGPTemporaryStreamEvent &pMethodOutResult, void * &pDataOutResult);
    void set_OnTemporaryStream(TSBPGPTemporaryStreamEvent pMethodValue, void * pDataValue);
    typedef void (SB_CALLBACK *TSBPGPTemporaryStreamEvent)(void * _ObjectData, TObjectHandle Sender, TStreamHandle &Stream, int8_t &FreeOnFinish);

[PHP]
    TSBPGPTemporaryStreamEvent|callable|NULL get_OnTemporaryStream()
    void set_OnTemporaryStream(TSBPGPTemporaryStreamEvent|callable|NULL $Value)
    callable TSBPGPTemporaryStreamEvent(TObject $Sender, TStream &$Stream, bool &$FreeOnFinish)

[Java]
    TSBPGPTemporaryStreamEvent getOnTemporaryStream();
    void setOnTemporaryStream(TSBPGPTemporaryStreamEvent Value);
    TSBPGPTemporaryStreamEvent.Callback OnTemporaryStream = new TSBPGPTemporaryStreamEvent.Callback() {
        public void TSBPGPTemporaryStreamEventCallback(TObject arg0, TElPGPCreateStreamEventParams arg1) {
            //...
        }
    }

Parameters

  • Stream - newly created stream to be used by the writer.
  • Filename - a file to be used by the writer.
  • FreeOnFinish - If True, the Stream will be destroyed by TElPGPWriter automatically.Otherwise, the stream should be destroyed by the application.

Description

    Sometimes writer needs a temporary buffer for processing. To make memory management more effective, instead of creating its own temporary stream, PGPWriter fires this event.
    You should create new stream yourself and return it as Stream parameter. The stream will not be disposed of automatically when it is no longer needed, so you can use one stream for many operations. Stream size is set to 0 when the stream is no longer used.
    If the application doesn't handle this event or returns nil (null, Nothing) in Stream parameter, then temporary in-memory stream is created and automatically disposed later.

Discuss this help topic in SecureBlackbox Forum