def encodeStream(stream, filter, parameters={}):
 if (filter == '/ASCIIHexDecode'):
  ret = asciiHexEncode(stream)
 elif (filter == '/ASCII85Decode'):
  ret = ascii85Encode(stream)
 elif (filter == '/LZWDecode'):
  ret = lzwEncode(stream, parameters)
 elif (filter == '/FlateDecode'):
  ret = flateEncode(stream, parameters)
 elif (filter == '/RunLengthDecode'):
  ret = runLengthEncode(stream)
 elif (filter == '/CCITTFaxDecode'):
  ret = ccittFaxEncode(stream, parameters)
 elif (filter == '/JBIG2Decode'):
  ret = jbig2Encode(stream, parameters)
 elif (filter == '/DCTDecode'):
  ret = dctEncode(stream, parameters)
 elif (filter == '/JPXDecode'):
  ret = jpxEncode(stream)
 elif (filter == '/Crypt'):
  ret = crypt(stream, parameters)
 else:
  ret = ((-1), ('Unknown filter "%s"' % filter))
 return ret

def encodeStream ( stream , filter , parameters = { } ) : if ( filter == '/ASCIIHexDecode' ) : ret = asciiHexEncode ( stream ) elif ( filter == '/ASCII85Decode' ) : ret = ascii85Encode ( stream ) elif ( filter == '/LZWDecode' ) : ret = lzwEncode ( stream , parameters ) elif ( filter == '/FlateDecode' ) : ret = flateEncode ( stream , parameters ) elif ( filter == '/RunLengthDecode' ) : ret = runLengthEncode ( stream ) elif ( filter == '/CCITTFaxDecode' ) : ret = ccittFaxEncode ( stream , parameters ) elif ( filter == '/JBIG2Decode' ) : ret = jbig2Encode ( stream , parameters ) elif ( filter == '/DCTDecode' ) : ret = dctEncode ( stream , parameters ) elif ( filter == '/JPXDecode' ) : ret = jpxEncode ( stream ) elif ( filter == '/Crypt' ) : ret = crypt ( stream , parameters ) else : ret = ( ( - 1 ) , ( 'Unknown filter "%s"' % filter ) ) return ret
encode the given stream .