|
Class: ObjectCoder
Object
|
+--Visitor
|
+--AspectVisitor
|
+--ObjectCoder
|
+--BaseNCoder
|
+--JSONPrinter
|
+--XMLCoder
- Package:
- stx:libbasic
- Category:
- System-Storage
- Version:
- rev:
1.25
date: 2019/03/22 12:45:30
- user: cg
- file: ObjectCoder.st directory: libbasic
- module: stx stc-classLibrary: libbasic
- Author:
- Stefan Vogel
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:]
OSI::ASN1_Coder
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 raises an error - it must be redefined in concrete classes **
encoding
-
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
-
nextPut: anObject with: aParameter
-
encode anObject onto my stream
-
nextPutAll: aCollectionOfObjects
-
encode all objects from the argument
-
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 your encoder supports this, redefine it there
initialization
-
close
-
close the underlying stream
-
emptyWriteStream
-
answer an empty stream for writing the encoded object
** This method raises an error - it must be redefined in concrete classes **
-
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
|