cryptoservices/filebasedcertificateandkeystores/source/shared/NullStream.h
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  @file 
       
    23  @internalTechnology
       
    24 */
       
    25  
       
    26 #ifndef __NullStream_h__
       
    27 #define __NullStream_h__
       
    28 
       
    29 #include <s32strm.h>
       
    30 #include <s32buf.h>
       
    31 
       
    32 /**
       
    33  * Implementation of the MStreamBuf interface that throws away all data written
       
    34  * to it.  It does not support reading.
       
    35  */
       
    36 
       
    37 class TNullBuf : public MStreamBuf
       
    38 	{
       
    39 public:
       
    40 	TNullBuf();
       
    41 	TUint BytesWritten();
       
    42 private:
       
    43 	virtual void DoWriteL(const TAny* aPtr,TInt aLength);
       
    44 private:
       
    45 	TUint iBytesWritten;
       
    46 	}; 
       
    47 
       
    48 /**
       
    49  * A write stream that throws away all its input, but keeps track of how many
       
    50  * bytes have been written to it.  It is used for determining the amount of
       
    51  * memory needed to store externalised objects.
       
    52  */
       
    53 
       
    54 class RNullWriteStream : public RWriteStream
       
    55 	{
       
    56 public:
       
    57 	RNullWriteStream();
       
    58 	TUint BytesWritten();
       
    59 private:
       
    60 	TNullBuf iSink;
       
    61 	};
       
    62 
       
    63 #endif