2 import javax
.microedition
.lcdui
.*;
6 public static int parseInt(String s
)
10 return Integer
.parseInt(s
);
19 public static int gc(String s
, int pos
)
32 public static String
gc(String s
, int c
, int pos
)
36 StringBuffer sb
= new StringBuffer(s
);
37 sb
.setCharAt(pos
, (char)c
);
47 public static InputStream
r(String resourceName
)
51 return FW
.fw
.getClass().getResourceAsStream(resourceName
);
59 public static void r(InputStream is
)
71 public static int rb(InputStream is
)
75 byte []b
= new byte[2];
80 if (is
.read(b
, 0, 1) == -1)
86 return 1000; //ERROR konstanta
91 public static String
nl(InputStream is
)
93 StringBuffer retVal
= new StringBuffer();
96 byte []b
= new byte[2];
97 boolean lineStarted
= false;
103 if ((b
[0] != '\n') && (b
[0] != '\r'))
105 retVal
.append((char)b
[0]);
118 return retVal
.toString();
121 return retVal
.toString();
124 public static Image
InternalImageFromImage(Image img
, int x
, int y
, int cx
, int cy
)
126 Image newImage
= Image
.createImage(cx
, cy
);
127 newImage
.getGraphics().drawImage(img
, -x
, -y
, Graphics
.TOP
|Graphics
.LEFT
);
131 public static Image
ii(Image img
, int x
, int y
, int cx
, int cy
)
134 { // j-a-s-d: this is to avoid AV false alarms
135 return InternalImageFromImage(img
, x
, y
, cx
, cy
);
139 return Image
.createImage(1, 1);
143 /* imageFromCanvas */
144 public static Image
ii(int x
, int y
, int cx
, int cy
)
146 return ii(M
.I
, x
, y
, cx
, cy
);
150 public static Image
ii(String buf
, int length
)
154 return Image
.createImage(buf
.getBytes(), 0, length
);
158 return Image
.createImage(1,1);