Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
2008-01-03 09:28
495 查看
1:IO读写
因为J2ME只支持有限的几个IO类,要用这几个类满足自己的需求确实不容易。
try
{
InputStream is = new Object().getClass().getResourceAsStream("/52.txt");
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
byte[] bytes = new byte[128];
int size;
while( (size = is.read(bytes)) != -1 ){
baos.write(bytes, 0, size);
}
data = baos.toByteArray();
iSize = data.length;
contentCan = new contentCanvas(new String(data));
is.close();
is = null;
baos.close();
baos = null;
}
catch (Exception e)
{
e.printStackTrace();
}
2:字符串转换成整数或其它primitive类型
image_1_num = Integer.parseInt(str3.substring(0,str3.indexOf("-")));
image_2_num = Integer.parseInt(str3.substring(str3.indexOf("-")+1));
用了无数次了,但每次还是忘记。
3:ChoiceGroup的一个小问题
看API文档
The
有以下问题要澄清:
1:第二个参数类型只能为EXCLUSIVE,
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1033616
因为J2ME只支持有限的几个IO类,要用这几个类满足自己的需求确实不容易。
try
{
InputStream is = new Object().getClass().getResourceAsStream("/52.txt");
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
byte[] bytes = new byte[128];
int size;
while( (size = is.read(bytes)) != -1 ){
baos.write(bytes, 0, size);
}
data = baos.toByteArray();
iSize = data.length;
contentCan = new contentCanvas(new String(data));
is.close();
is = null;
baos.close();
baos = null;
}
catch (Exception e)
{
e.printStackTrace();
}
2:字符串转换成整数或其它primitive类型
image_1_num = Integer.parseInt(str3.substring(0,str3.indexOf("-")));
image_2_num = Integer.parseInt(str3.substring(str3.indexOf("-")+1));
用了无数次了,但每次还是忘记。
3:ChoiceGroup的一个小问题
看API文档
public ChoiceGroup(String label, int choiceType, String[] stringElements, Image[] imageElements)Creates a new
ChoiceGroup, specifying its title, the type of the
ChoiceGroup, and an array of
Stringsand
Imagesto be used as its initial contents.The type must be one of
EXCLUSIVE,
MULTIPLE, or
POPUP. The
IMPLICITtype is not allowed for
ChoiceGroup.
The
stringElementsarray must be non-null and every array element must also be non-null. The length of the
stringElementsarray determines the number of elements in the
ChoiceGroup. The
imageElementsarray may be
nullto indicate that the
ChoiceGroupelements have no images. If the
imageElementsarray is non-null, it must be the same length as the
stringElementsarray. Individual elements of the
imageElementsarray may be
nullin order to indicate the absence of an image for the corresponding
ChoiceGroupelement. Non-null elements of the
imageElementsarray may refer to mutable or immutable images.
有以下问题要澄清:
1:第二个参数类型只能为EXCLUSIVE,
MULTIPLE, or
POPUP,IMPLICIT 不被支持,这点和List不同。
2:第三个参数不能为null。
3:第四个参数可以为null。
但是不知道为什么,在我的开发中,始终无法用POPUP类型,Eclipse老提示无法解析此类型。
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1033616
相关文章推荐
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
- 分析定位问题思路