os/security/cryptoservices/filebasedcertificateandkeystores/source/shared/NullStream.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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  @file 
    21  @internalTechnology
    22 */
    23  
    24 #ifndef __NullStream_h__
    25 #define __NullStream_h__
    26 
    27 #include <s32strm.h>
    28 #include <s32buf.h>
    29 
    30 /**
    31  * Implementation of the MStreamBuf interface that throws away all data written
    32  * to it.  It does not support reading.
    33  */
    34 
    35 class TNullBuf : public MStreamBuf
    36 	{
    37 public:
    38 	TNullBuf();
    39 	TUint BytesWritten();
    40 private:
    41 	virtual void DoWriteL(const TAny* aPtr,TInt aLength);
    42 private:
    43 	TUint iBytesWritten;
    44 	}; 
    45 
    46 /**
    47  * A write stream that throws away all its input, but keeps track of how many
    48  * bytes have been written to it.  It is used for determining the amount of
    49  * memory needed to store externalised objects.
    50  */
    51 
    52 class RNullWriteStream : public RWriteStream
    53 	{
    54 public:
    55 	RNullWriteStream();
    56 	TUint BytesWritten();
    57 private:
    58 	TNullBuf iSink;
    59 	};
    60 
    61 #endif