update dev300-m58
[ooovba.git] / package / inc / ByteChucker.hxx
blobd0906c06bed3650d1329d595eb6fedefd5747bb5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ByteChucker.hxx,v $
10 * $Revision: 1.14 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _BYTE_CHUCKER_HXX_
31 #define _BYTE_CHUCKER_HXX_
33 #include <com/sun/star/uno/Sequence.h>
34 #include <com/sun/star/uno/Reference.h>
35 #include <com/sun/star/io/BufferSizeExceededException.hpp>
36 #include <com/sun/star/io/IOException.hpp>
37 #include <com/sun/star/io/NotConnectedException.hpp>
38 #include <com/sun/star/uno/RuntimeException.hpp>
39 #include <com/sun/star/lang/IllegalArgumentException.hpp>
41 namespace com { namespace sun { namespace star {
42 namespace io { class XSeekable; class XOutputStream; }
43 } } }
44 class ByteChucker
46 protected:
47 com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > xStream;
48 com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek;
49 com::sun::star::uno::Sequence < sal_Int8 > a1Sequence, a2Sequence, a4Sequence;
50 sal_Int8 * const p1Sequence, * const p2Sequence, * const p4Sequence;
52 public:
53 ByteChucker (com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xOstream);
54 ~ByteChucker();
56 void WriteBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData )
57 throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
59 sal_Int64 GetPosition()
60 throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
62 ByteChucker& operator << (sal_Int8 nInt8);
63 ByteChucker& operator << (sal_Int16 nInt16);
64 ByteChucker& operator << (sal_Int32 nInt32);
65 ByteChucker& operator << (sal_uInt8 nuInt8);
66 ByteChucker& operator << (sal_uInt16 nuInt16);
67 ByteChucker& operator << (sal_uInt32 nuInt32);
70 #endif