Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 // Descriptors support a maximum of 2^28 bytes.
19 // The highest 4 bits are used for other purposes.
20 static const TInt KMaxDesLen = (2 << 28) - 1;
21 static const TInt KMinDesLen = -(2 << 28);
26 CBufferReader::CBufferReader(const TDesC8& aBuffer)
27 : CReader(aBuffer, CReader::EBuffer)
34 CBufferReader::CBufferReader(const TDesC8& aBuffer, TReaderType aType)
35 : CReader(aBuffer, aType)
42 CBufferReader::~CBufferReader()
49 CBufferReader* CBufferReader::NewLC(const TDesC8& aBuffer)
51 CBufferReader* self = new(ELeave) CBufferReader(aBuffer);
52 CleanupStack::PushL(self);
60 void CBufferReader::ConstructL()
67 void CBufferReader::Reset()
75 void CBufferReader::SeekL(TInt64 aOffset)
77 // Symbian OS descriptors support a maximum size of 2^28 bytes.
78 if (aOffset > (TInt64)KMaxDesLen)
80 User::Leave(KErrNotSupported);
83 if (aOffset < (TInt64)KMinDesLen)
85 User::Leave(KErrNotSupported);
88 TInt low = (TInt)I64LOW(aOffset);
95 void CBufferReader::SeekL(TInt aOffset)
97 User::LeaveIfError(CReader::Seek(aOffset));