1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsIBinaryInputStream.idl"
9 * @see nsIObjectOutputStream
10 * @see nsIBinaryInputStream
13 [scriptable
, builtinclass
, uuid(6c248606
-4eae
-46fa
-9df0
-ba58502368eb
)]
14 interface nsIObjectInputStream
: nsIBinaryInputStream
17 * Read an object from this stream to satisfy a strong or weak reference
18 * to one of its interfaces. If the interface was not along the primary
19 * inheritance chain ending in the "root" or XPCOM-identity nsISupports,
20 * readObject will QueryInterface from the deserialized object root to the
21 * correct interface, which was specified when the object was serialized.
23 * @see nsIObjectOutputStream
25 nsISupports readObject
(in boolean aIsStrongRef
);
27 [notxpcom
] nsresult readID
(out nsID aID
);
30 * Optimized deserialization support -- see nsIStreamBufferAccess.idl.
32 [notxpcom
] charPtr getBuffer
(in uint32_t aLength
, in uint32_t aAlignMask
);
33 [notxpcom
] void putBuffer
(in charPtr aBuffer
, in uint32_t aLength
);
38 already_AddRefed
<nsIObjectInputStream
>
39 NS_NewObjectInputStream
(nsIInputStream
* aOutputStream
);
42 NS_ReadOptionalObject
(nsIObjectInputStream
* aStream
, bool aIsStrongRef
,
43 nsISupports
* *aResult
)
46 nsresult rv
= aStream
->ReadBoolean
(&nonnull
);
47 if
(NS_SUCCEEDED
(rv
)) {
49 rv
= aStream
->ReadObject
(aIsStrongRef
, aResult
);