Hex Artifact Content

Artifact eae116c9058f5cfb9be42505a3c3e8a093262bee:


0000: 23 20 43 6f 6d 70 61 74 69 62 69 6c 69 74 79 0a  # Compatibility.
0010: 0a 53 71 75 69 72 72 65 6c 4a 4d 45 20 61 69 6d  .SquirrelJME aim
0020: 73 20 74 6f 20 62 65 20 63 6f 6d 70 61 74 69 62  s to be compatib
0030: 6c 65 20 77 69 74 68 20 6d 6f 73 74 20 70 72 6f  le with most pro
0040: 67 72 61 6d 73 20 68 6f 77 65 76 65 72 20 74 68  grams however th
0050: 65 72 65 20 61 72 65 0a 73 69 74 75 61 74 69 6f  ere are.situatio
0060: 6e 73 20 61 6e 64 20 72 61 72 65 20 65 64 67 65  ns and rare edge
0070: 20 63 61 73 65 73 20 77 68 65 72 65 20 74 68 65   cases where the
0080: 72 65 20 77 69 6c 6c 20 62 65 20 6e 6f 20 63 6f  re will be no co
0090: 6d 70 61 74 69 62 69 6c 69 74 79 2e 20 54 68 69  mpatibility. Thi
00a0: 73 20 69 73 0a 74 6f 20 6d 61 6b 65 20 74 68 65  s is.to make the
00b0: 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20   implementation 
00c0: 65 61 73 69 65 72 2e 0a 0a 23 23 20 60 46 6c 75  easier...## `Flu
00d0: 73 68 61 62 6c 65 60 20 49 6e 74 65 72 66 61 63  shable` Interfac
00e0: 65 0a 0a 54 68 65 20 69 6e 74 65 72 66 61 63 65  e..The interface
00f0: 20 60 46 6c 75 73 68 61 62 6c 65 60 20 64 6f 65   `Flushable` doe
0100: 73 20 6e 6f 74 20 65 78 69 73 74 20 69 6e 20 4a  s not exist in J
0110: 61 76 61 20 4d 45 20 61 6e 64 20 61 73 20 73 75  ava ME and as su
0120: 63 68 20 69 74 20 64 6f 65 73 20 6e 6f 74 0a 65  ch it does not.e
0130: 78 69 73 74 20 69 6e 20 53 71 75 69 72 72 65 6c  xist in Squirrel
0140: 4a 4d 45 2e 0a 0a 23 23 20 4c 43 44 55 49 20 44  JME...## LCDUI D
0150: 69 73 70 6c 61 79 20 49 6e 70 75 74 0a 0a 4f 6e  isplay Input..On
0160: 6c 79 20 74 68 65 20 66 69 72 73 74 20 64 69 73  ly the first dis
0170: 70 6c 61 79 20 28 69 6e 64 65 78 20 7a 65 72 6f  play (index zero
0180: 29 20 73 75 70 70 6f 72 74 73 20 69 6e 70 75 74  ) supports input
0190: 20 65 76 65 6e 74 73 20 73 75 63 68 20 61 73 20   events such as 
01a0: 6b 65 79 62 6f 61 72 64 2c 0a 62 75 74 74 6f 6e  keyboard,.button
01b0: 73 2c 20 6d 69 63 65 2c 20 61 6e 64 20 74 6f 75  s, mice, and tou
01c0: 63 68 73 63 72 65 65 6e 2e 20 41 6e 79 20 73 65  chscreen. Any se
01d0: 63 6f 6e 64 61 72 79 20 64 69 73 70 6c 61 79 73  condary displays
01e0: 20 77 68 69 63 68 20 61 72 65 20 61 74 74 61 63   which are attac
01f0: 68 65 64 0a 77 69 6c 6c 20 6e 6f 74 20 68 61 76  hed.will not hav
0200: 65 20 65 76 65 6e 74 73 20 68 61 6e 64 6c 65 64  e events handled
0210: 20 66 6f 72 20 74 68 65 6d 20 61 74 20 61 6c 6c   for them at all
0220: 2e 20 54 68 69 73 20 69 73 20 74 6f 20 6d 61 6b  . This is to mak
0230: 65 20 69 74 20 65 61 73 69 65 72 20 74 6f 0a 69  e it easier to.i
0240: 6d 70 6c 65 6d 65 6e 74 2e 0a 0a 23 23 20 4c 69  mplement...## Li
0250: 6d 69 74 65 64 20 4e 65 74 77 6f 72 6b 20 49 6e  mited Network In
0260: 74 65 72 66 61 63 65 20 53 75 70 70 6f 72 74 0a  terface Support.
0270: 0a 54 68 65 20 47 65 6e 65 72 69 63 20 43 6f 6e  .The Generic Con
0280: 6e 65 63 74 69 6f 6e 20 46 72 61 6d 65 77 6f 72  nection Framewor
0290: 6b 20 28 47 43 46 29 20 68 61 73 20 41 50 49 20  k (GCF) has API 
02a0: 74 6f 20 70 72 6f 76 69 64 65 20 61 63 63 65 73  to provide acces
02b0: 73 20 74 6f 20 76 61 72 69 6f 75 73 0a 73 79 73  s to various.sys
02c0: 74 65 6d 20 69 6e 74 65 72 66 61 63 65 73 2c 20  tem interfaces, 
02d0: 57 69 46 69 20 64 65 76 69 63 65 73 2c 20 33 47  WiFi devices, 3G
02e0: 50 50 2f 43 44 4d 41 20 28 4d 6f 62 69 6c 65 20  PP/CDMA (Mobile 
02f0: 64 61 74 61 29 2c 20 61 6e 64 20 64 69 61 6c 2d  data), and dial-
0300: 75 70 0a 63 6f 6e 6e 65 63 74 69 6f 6e 73 2e 20  up.connections. 
0310: 53 69 6e 63 65 20 73 75 70 70 6f 72 74 69 6e 67  Since supporting
0320: 20 61 6c 6c 20 6f 66 20 74 68 65 73 65 20 61 72   all of these ar
0330: 65 20 63 6f 6d 70 6c 69 63 61 74 65 64 2c 20 73  e complicated, s
0340: 75 70 70 6f 72 74 20 66 6f 72 20 74 68 65 73 65  upport for these
0350: 0a 61 63 72 6f 73 73 20 73 79 73 74 65 6d 73 20  .across systems 
0360: 77 69 6c 6c 20 62 65 20 6c 69 6d 69 74 65 64 20  will be limited 
0370: 74 6f 20 61 6e 20 61 73 20 6e 65 65 64 65 64 20  to an as needed 
0380: 62 61 73 69 73 2e 0a 0a 23 23 20 60 52 65 61 64  basis...## `Read
0390: 65 72 60 27 73 20 60 6c 6f 63 6b 60 20 49 73 20  er`'s `lock` Is 
03a0: 60 6e 75 6c 6c 60 0a 0a 53 69 6e 63 65 20 53 71  `null`..Since Sq
03b0: 75 69 72 72 65 6c 4a 4d 45 20 75 73 65 73 20 61  uirrelJME uses a
03c0: 20 72 65 66 65 72 65 6e 63 65 20 63 6f 75 6e 74   reference count
03d0: 65 64 20 67 61 72 62 61 67 65 20 63 6f 6c 6c 65  ed garbage colle
03e0: 63 74 6f 72 20 74 68 65 20 60 52 65 61 64 65 72  ctor the `Reader
03f0: 60 27 73 0a 60 6c 6f 63 6b 60 20 6f 62 6a 65 63  `'s.`lock` objec
0400: 74 20 69 6e 20 74 68 65 20 64 65 66 61 75 6c 74  t in the default
0410: 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 69 73 20   constructor is 
0420: 73 65 74 20 74 6f 20 60 6e 75 6c 6c 60 20 69 6e  set to `null` in
0430: 73 74 65 61 64 20 6f 66 20 60 74 68 69 73 60 2e  stead of `this`.
0440: 0a 54 68 69 73 20 69 73 20 73 6f 20 74 68 61 74  .This is so that
0450: 20 72 65 61 64 65 72 73 20 64 6f 20 6e 6f 74 20   readers do not 
0460: 72 65 6d 61 69 6e 20 69 6e 20 6d 65 6d 6f 72 79  remain in memory
0470: 20 75 6e 61 62 6c 65 20 74 6f 20 62 65 20 66 72   unable to be fr
0480: 65 65 64 20 62 65 63 61 75 73 65 0a 6f 62 6a 65  eed because.obje
0490: 63 74 73 20 73 74 69 6c 6c 20 72 65 66 65 72 20  cts still refer 
04a0: 74 6f 20 74 68 65 6d 20 61 6e 64 20 73 75 63 68  to them and such
04b0: 2e 0a 0a 23 23 20 60 53 55 50 45 52 60 20 49 73  ...## `SUPER` Is
04c0: 20 41 6c 77 61 79 73 20 53 65 74 0a 0a 49 6e 20   Always Set..In 
04d0: 61 6c 6c 20 63 6c 61 73 65 73 20 74 68 65 20 60  all clases the `
04e0: 53 55 50 45 52 60 20 66 6c 61 67 20 69 73 20 61  SUPER` flag is a
04f0: 73 73 75 6d 65 64 20 74 6f 20 62 65 20 73 65 74  ssumed to be set
0500: 2c 20 74 68 69 73 20 66 6c 61 67 20 6a 75 73 74  , this flag just
0510: 20 6d 6f 64 69 66 69 65 73 0a 74 68 65 20 62 65   modifies.the be
0520: 68 61 76 69 6f 72 20 6f 66 20 60 69 6e 76 6f 6b  havior of `invok
0530: 65 73 70 65 63 69 61 6c 60 2e 20 57 68 65 6e 20  especial`. When 
0540: 69 74 20 69 73 20 6e 6f 74 20 73 65 74 20 74 68  it is not set th
0550: 65 6e 20 74 68 61 74 20 69 6e 73 74 72 75 63 74  en that instruct
0560: 69 6f 6e 0a 63 61 6e 20 69 6e 76 6f 6b 65 20 6e  ion.can invoke n
0570: 65 61 72 6c 79 20 65 76 65 72 79 20 6d 65 74 68  early every meth
0580: 6f 64 20 64 69 72 65 63 74 6c 79 20 28 69 74 20  od directly (it 
0590: 77 61 73 20 63 61 6c 6c 65 64 20 62 65 66 6f 72  was called befor
05a0: 65 0a 60 69 6e 76 6f 6b 65 6e 6f 6e 76 69 72 74  e.`invokenonvirt
05b0: 75 61 6c 60 29 2e 20 48 6f 77 65 76 65 72 2c 20  ual`). However, 
05c0: 74 68 65 20 4a 61 76 61 20 63 6f 6d 70 69 6c 65  the Java compile
05d0: 72 20 73 69 6e 63 65 20 4a 61 76 61 20 31 2e 31  r since Java 1.1
05e0: 20 61 6c 77 61 79 73 20 73 65 74 0a 74 68 65 20   always set.the 
05f0: 66 6c 61 67 20 66 6f 72 20 63 6c 61 73 73 65 73  flag for classes
0600: 20 69 74 20 63 6f 6d 70 69 6c 65 64 2e 20 53 69   it compiled. Si
0610: 6e 63 65 20 43 4c 44 43 20 31 2e 30 20 77 61 73  nce CLDC 1.0 was
0620: 20 72 65 6c 65 61 73 65 64 20 77 65 6c 6c 20 61   released well a
0630: 66 74 65 72 0a 4a 61 76 61 20 32 20 77 61 73 20  fter.Java 2 was 
0640: 61 6e 64 20 69 73 20 64 65 66 69 6e 65 64 20 61  and is defined a
0650: 73 20 61 20 4a 61 76 61 20 32 20 76 69 72 74 75  s a Java 2 virtu
0660: 61 6c 20 6d 61 63 68 69 6e 65 20 61 6c 6c 20 63  al machine all c
0670: 6f 64 65 20 77 72 69 74 74 65 6e 20 66 6f 72 0a  ode written for.
0680: 4a 32 4d 45 20 73 68 6f 75 6c 64 20 68 61 76 65  J2ME should have
0690: 20 63 6c 61 73 73 65 73 20 77 68 65 72 65 20 74   classes where t
06a0: 68 69 73 20 66 6c 61 67 20 69 73 20 73 65 74 2e  his flag is set.
06b0: 20 41 73 20 73 75 63 68 20 69 6e 73 74 65 61 64   As such instead
06c0: 20 6f 66 0a 73 75 70 70 6f 72 74 69 6e 67 20 74   of.supporting t
06d0: 68 65 20 6c 6f 67 69 63 20 74 6f 20 68 61 6e 64  he logic to hand
06e0: 6c 65 20 63 61 73 65 73 20 77 68 65 72 65 20 69  le cases where i
06f0: 74 20 69 73 20 6e 6f 74 20 73 65 74 2c 20 74 68  t is not set, th
0700: 65 20 66 6c 61 67 20 77 69 6c 6c 20 6a 75 73 74  e flag will just
0710: 0a 62 65 20 69 67 6e 6f 72 65 64 20 61 6e 64 20  .be ignored and 
0720: 61 73 73 75 6d 65 64 20 74 6f 20 62 65 20 73 65  assumed to be se
0730: 74 2e 0a 0a 23 23 20 53 75 70 70 6f 72 74 65 64  t...## Supported
0740: 20 45 6e 63 6f 64 69 6e 67 73 0a 0a 4f 6e 6c 79   Encodings..Only
0750: 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63   the following c
0760: 68 61 72 61 63 74 65 72 20 65 6e 63 6f 64 69 6e  haracter encodin
0770: 67 73 20 61 72 65 20 73 75 70 70 6f 72 74 65 64  gs are supported
0780: 3a 0a 0a 20 2a 20 5f 41 53 43 49 49 5f 0a 20 2a  :.. * _ASCII_. *
0790: 20 5f 49 42 4d 30 33 37 5f 0a 20 2a 20 5f 49 53   _IBM037_. * _IS
07a0: 4f 2d 38 38 35 39 2d 31 5f 0a 20 2a 20 5f 55 54  O-8859-1_. * _UT
07b0: 46 2d 38 5f 0a 0a 4e 6f 74 65 20 74 68 61 74 20  F-8_..Note that 
07c0: 55 54 46 20 63 6f 64 65 70 6f 69 6e 74 73 20 61  UTF codepoints a
07d0: 62 6f 76 65 20 55 2b 46 46 46 46 20 61 72 65 20  bove U+FFFF are 
07e0: 6e 6f 74 20 66 75 6c 6c 79 20 73 75 70 70 6f 72  not fully suppor
07f0: 74 65 64 20 61 6e 64 20 61 72 65 20 6e 6f 74 0a  ted and are not.
0800: 61 76 61 69 6c 61 62 6c 65 20 69 6e 20 4a 61 76  available in Jav
0810: 61 20 4d 45 2e 20 53 75 72 72 6f 67 61 74 65 20  a ME. Surrogate 
0820: 70 61 69 72 73 20 69 6e 20 55 54 46 2d 31 36 20  pairs in UTF-16 
0830: 77 69 6c 6c 20 62 65 20 65 6e 63 6f 64 65 64 20  will be encoded 
0840: 69 6e 20 55 54 46 2d 38 20 61 73 0a 73 69 78 20  in UTF-8 as.six 
0850: 62 79 74 65 73 2e 20 41 64 64 69 74 69 6f 6e 61  bytes. Additiona
0860: 6c 6c 79 20 77 68 65 6e 20 64 65 63 6f 64 69 6e  lly when decodin
0870: 67 2c 20 69 66 20 61 20 73 65 71 75 65 6e 63 65  g, if a sequence
0880: 20 74 68 61 74 20 69 73 20 61 62 6f 76 65 20 55   that is above U
0890: 2b 46 46 46 46 20 69 73 0a 72 65 61 64 20 74 68  +FFFF is.read th
08a0: 65 6e 20 69 74 20 77 69 6c 6c 20 64 65 63 6f 64  en it will decod
08b0: 65 20 74 6f 20 74 68 65 20 72 65 70 6c 61 63 65  e to the replace
08c0: 6d 65 6e 74 20 63 68 61 72 61 63 74 65 72 2e 20  ment character. 
08d0: 54 68 69 73 20 6d 61 79 20 63 61 75 73 65 20 61  This may cause a
08e0: 20 6c 6f 73 73 20 6f 66 0a 6f 72 20 6d 75 74 61   loss of.or muta
08f0: 74 69 6f 6e 20 6f 66 20 64 61 74 61 20 77 68 65  tion of data whe
0900: 6e 20 70 72 6f 63 65 73 73 69 6e 67 20 66 69 6c  n processing fil
0910: 65 73 2e 0a 0a 53 65 65 3a 0a 0a 20 2a 20 3c 68  es...See:.. * <h
0920: 74 74 70 73 3a 2f 2f 75 6e 69 63 6f 64 65 2e 6f  ttps://unicode.o
0930: 72 67 2f 66 61 71 2f 75 74 66 5f 62 6f 6d 2e 68  rg/faq/utf_bom.h
0940: 74 6d 6c 23 75 74 66 38 2d 34 3e 0a 20 2a 20 3c  tml#utf8-4>. * <
0950: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 75 6e 69 63  https://www.unic
0960: 6f 64 65 2e 6f 72 67 2f 72 65 70 6f 72 74 73 2f  ode.org/reports/
0970: 74 72 32 36 2f 3e 0a 0a                          tr26/>..