(class)
An input stream which deserializes from a byte stream.
| default: | Create an input stream for deserialization. |
accessor public inline SerializeInputStream.known-values:#
FastArray
| manifest: | The manifest associated with the stream. |
| open?: | Indicate if this Stream is currently open, should return false once Stream-of.close has been called. |
accessor public SerializeInputStream.open?:
bool
| origin-url: | Returns the Url that this stream was opened from, or null, if no such Url exists. |
accessor public SerializeInputStream.origin-url:#
Url
| protocol: | Serialization protocol used by this stream. |
| close: | Close Stream, should make stream un-usable and make sure that Stream-of.open? return false once this has been called. |
|
public
| {SerializeInputStream.close}:void |
| copy-out: | Deserializes multiple values from stream into another stream. |
| import-package: | Returns the package given name and location information. |
|
public
| {SerializeInputStream.next-one}:any |
| package-lookup: | Returns the object represented by the name in the given package. |
| peek-one: | Deserializes next element without removing from stream. |
|
public
| {SerializeInputStream.peek-one}:(any, bool) |
| read: | Deserializes multiple values from stream. |
|
public
| {SerializeInputStream.read out:#Array = null, start:int = 0, n:int = max-int - start, allow-short-read?:bool = false, non-blocking?:bool = false }:(vals:Array, number-read:int) |
| read-anys: | Deserializes multiple values from stream. |
|
public
| {SerializeInputStream.read-anys out:#Array = null, start:int = 0, n:int = max-int - start, allow-short-read?:bool = false, non-blocking?:bool = false }:(vals:Array, n:int) |
|
public
| {SerializeInputStream.read-class-version}:int |
| read-one: | Deserializes next element from stream. |
|
public
| {SerializeInputStream.read-one}:(any, bool) |
|
public
| {SerializeInputStream.read-one-compact compile-time-type:Type }:any |
|
public
| {SerializeInputStream.to-Iterator}:{Iterator-of any} |
| verify-class-version: | Read a version number for the class being deserialized, and verify that it has the expected value. |
|
public
| {SerializeInputStream.verify-class-version version:int}:void |
(constructor)
Create an input stream for deserialization.
raw-byte-stream: The byte stream from which the serialized objects will be read.
close-stream-on-close?: If true (the default), then the byte stream raw-byte-stream will be closed when this stream is closed.
manifest: The manifest used to find deserialized packages, defaulting to the applet's manifest. Usually the default is sufficient, but in cases involving incomplete manifest delegation it may be necessary to pass {get-default-manifest} to force the use of the manifest of the package creating this object.
Notes
(accessor)
accessor public inline SerializeInputStream.known-values:#
FastArray Set of known values
Description
This is the
known-values array that was last given to the
default constructor or
reopen method.
Introduced in:
version 6.0
(accessor)
The manifest associated with the stream.
Description
Introduced in:
version 6.0
(accessor)
accessor public SerializeInputStream.open?:
bool Indicate if this Stream is currently open, should return false once Stream-of.close has been called.
Notes
Overriding
Subclasses must provide this.
(accessor)
accessor public SerializeInputStream.origin-url:#
Url Returns the Url that this stream was opened from, or null, if no such Url exists.
Example
{read-open {url "file://c:/foo.txt"}}.origin-url
would return the
Url file://c:/foo.txt (assuming such a file exists).
On the other hand,
{{TextInputStream-from String} "foo"}.origin-url would return
null.
(accessor)
Serialization protocol used by this stream.
Description
This is read from the stream itself.
Introduced in:
version 6.0
(accessor)
Gets a raw byte stream for customized deserialization.
(method)
| public
| {SerializeInputStream.close}:void |
Close Stream, should make stream un-usable and make sure that Stream-of.open? return false once this has been called.
(method)
Deserializes multiple values from stream into another stream.
Description
This may only be used when all the values satisfy the conditions allowing them to be read using
read-one. See that method for details.
See
InputStream-of.copy-out for details on the parameters.
(method)
Returns the package given name and location information.
name: The name of the package. If null, the applet's package will be returned.
Returns
Returns a package.
Description
This is invoked internally when deserializing packages. It is not intended to be invoked directly.
The default implementation will import the package by name, ignoring the locator.
To implement different behavior, you must override this method and
SerializeOutputStream.get-package-locator in subclasses.
(method)
| public
| {SerializeInputStream.next-one}:any |
(method)
Returns the object represented by the name in the given package.
package: The package associated with the name.
name: The name provided to be looked up in the package.
Returns
Returns the value in the package associated with the name.
Description
The default serialization will lookup the name in the package using
Package.lookup. Overriding this method is the only way to handle named types, other than classes, that have changed in an incompatible way.
(method)
| public
| {SerializeInputStream.peek-one}:(any, bool) |
Deserializes next element without removing from stream.
Description
Second argument indicates whether the end of stream has been reached, in which case the first argument will be null.
The next call to
read-one will return the same values.
Note that this may only be used when it is safe to use
read-one. See that method for details.
Also see
peek-one.
(method)
| public
| {SerializeInputStream.read out:#Array = null, start:int = 0, n:int = max-int - start, allow-short-read?:bool = false, non-blocking?:bool = false }:(vals:Array, number-read:int) |
Deserializes multiple values from stream.
Description
This may only be used when all the values satisfy the conditions allowing them to be read using
read-one. See that method for details.
See
InputStream-of.read for details on the parameters.
(method)
| public
| {SerializeInputStream.read-anys out:#Array = null, start:int = 0, n:int = max-int - start, allow-short-read?:bool = false, non-blocking?:bool = false }:(vals:Array, n:int) |
Deserializes multiple values from stream.
Description
This is the same as
read.
(method)
| public
| {SerializeInputStream.read-class-version}:int |
Reads a version number for the class being deserialized.
Returns
Returns the version for the class written during serialization.
Description
This version can be compared to the current version of the class during deserialization.
(method)
| public
| {SerializeInputStream.read-one}:(any, bool) |
Deserializes next element from stream.
Description
Second argument indicates whether the end of stream has been reached, in which case the first argument will be null.
This should not be used to read values that were not written using
SerializeOutputStream.write-one or
write-one-compact, and will only work with the latter if
SerializeProtocol version-4-0 is being used or if the value is a proc or a regular class instance (i.e., subtypes of
Object).
Also see
read-one.
(method)
| public
| {SerializeInputStream.read-one-compact compile-time-type:Type }:any |
Read value using compact representation.
Introduced in:
version 6.0
(method)
Reopen this stream.
Description
Allows the stream to be reused after it has been closed.
The arguments are the same as used for the
default constructor and this is semantically equivalent to constructing a new stream with the given arguments.
Both
manifest and
known-values will default to their existing values.
(method)
| public
| {SerializeInputStream.to-Iterator}:{Iterator-of any} |
Returns a deserializing iterator.
Description
This returns an iterator that uses
read-one to read values from the stream. See that method for details and restrictions.
(method)
| public
| {SerializeInputStream.verify-class-version version:int}:void |
Read a version number for the class being deserialized, and verify that it has the expected value.
version: The version that must match the object being deserialized.
Description