基于MIDP实现ResourceBundle类[3]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

    private void readToVector() throws IOException
    {
        InputStream is = this.getInputStreamFromFile();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        int c = 0;
        int index = 0;
        while ((c = is.read()) != -1)
        {
            if (c == '\n' || c == '\r')
            {
                String s = baos.toString();
                int i = s.indexOf('=');
                if (i != -1)
                {
                    if (s.substring(0, i).endsWith(String.valueOf(index)))
                    {
                        indexVector.addElement(s.substring(i + 1).trim());
                        index++;
                    } else
                    {
                        throw new IOException("index error");
                    }
                }
                baos.reset();
            } else
            {
                baos.write(c);
            }
        }
    }

本文关键:基于MIDP实现ResourceBundle类
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top