|
Class: ObjectCoder
Object
|
+--Visitor
|
+--AspectVisitor
|
+--ObjectCoder
|
+--BaseNCoder
|
+--JSONPrinter
|
+--XMLCoder
- Package:
- stx:libbasic
- Category:
- System-Storage
- Version:
- rev:
1.33
date: 2024/03/19 12:07:49
- user: cg
- file: ObjectCoder.st directory: libbasic
- module: stx stc-classLibrary: libbasic
This is an abstract class. Subclasses implement encoding and decoding
of Objects onto resp. from a stream. Possible coders are ASN.1/BER,
CORBA/CDR, BOSS, RMI ...
Classes which implement basic types (Boolean, Integer, Float, ...)
implement the visitor methods #acceptVisitor:with:, which dispatches onto an ObjectCoder.
[instance variables:]
stream <Stream> the stream we read/write the encodings from/to
[class variables:]
copyrightCOPYRIGHT (c) 2000 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
encoding / decoding
-
decode: aByteArrayOrString
-
decode aByteArrayOrString
Usage example(s):
Base64Coder encode:#[1 2 16rFe 16rFF]
Base64Coder decode:'AQL+/w=='
(Base64Coder decode:(Base64Coder encode:#[1 2 16rFe 16rFF])) = #[1 2 16rFe 16rFF]
|
-
decodingOf: anObject
-
use decode
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
encode: anObject
-
encode anObject.
Some subclasses (eg. XMLCoder) allow arbitrary objects to be encoded/decoded,
others don't (eg. Base64Coder)
Usage example(s):
Base64Coder encode:#[1 2 16rFe 16rFF]
Base64Coder encode:'hello'
OSI::BERCoder encode:'hello'
|
-
encode: anObject on: aStream
-
encode anObject onto a stream
Some subclasses (eg. XMLCoder) allow arbitrary objects to be encoded/decoded,
others don't (eg. Base64Coder)
-
encode: anObject on: aStream with: info
-
encode anObject onto a stream
Some subclasses (eg. XMLCoder) allow arbitrary objects to be encoded/decoded,
others don't (eg. Base64Coder)
-
encode: anObject with: aParameter
-
encode anObject onto a stream
Some subclasses (eg. XMLCoder) allow arbitrary objects to be encoded/decoded,
others don't (eg. Base64Coder)
-
encodingOf: anObject
-
use #encode:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
encodingOf: anObject with: aParameter
-
use #encode:with:
** This is an obsolete interface - do not use it (it may vanish in future versions) **
instance creation
-
on: aStream
-
return an encoder/decoder for a stream
accessing
-
contents
-
decoding
-
next
-
read, decode and return the next object
** This method must be redefined in concrete classes (subclassResponsibility) **
encoding
-
encode: anObject
-
-
encode: anObject on: aStream
-
-
encode: anObject on: aStream with: info
-
-
encodingOf: anObject
-
answer the encoded argument anObject
-
encodingOf: anObject with: aParameter
-
answer the encoded argument anObject
-
endEncoding
-
redefinable - allows subclass to create a file trailer or similar stuff
-
nextPut: anObject
-
encode anObject onto my stream.
Anser anObject
-
nextPut: anObject with: aParameter
-
encode anObject onto my stream
-
nextPutAll: aCollectionOfObjects
-
encode all objects from the argument.
Answer the receiver
-
startEncoding
-
redefinable - allows subclass to create a file header or similar stuff
encoding-smalltalk types
-
visitBlock: aBlock with: aParameter
-
encoding of blocks is rather difficult and an error by default.
If a concrete encoder supports this, redefine it there
initialization
-
close
-
close the underlying stream
-
emptyWriteStream
-
answer an empty stream for writing the encoded object
** This method must be redefined in concrete classes (subclassResponsibility) **
-
flush
-
flush possibly internally buffered data.
Nothing is done by default. Subclasses may redefine this
-
reset
-
reset the coder
private-accessing
-
stream
-
return my input or output stream
-
stream: aStream
-
set my input or output stream
|