Discuss this help topic in SecureBlackbox Forum



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

This event is fired when temporary stream is needed.


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

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

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

    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);

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

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


  • 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.


    Sometimes writer needs a temporary buffer for processing. To make memory management more effective, instead of creating it's 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's 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