📄 resourcebundle.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: ResourceBundle.java
package com.modofo.mofire;
import java.io.*;
import java.util.Hashtable;
public class ResourceBundle
{
private Hashtable map;
private static ResourceBundle instance = null;
private ResourceBundle(String fileName)
throws IOException
{
map = new Hashtable();
StringBuffer completeFileName = new StringBuffer();
completeFileName.append("/");
completeFileName.append(fileName);
completeFileName.append("_");
completeFileName.append(System.getProperty("microedition.locale"));
completeFileName.append(".properties");
InputStream in = getClass().getResourceAsStream(completeFileName.toString());
if (in == null)
{
String x = completeFileName.toString();
completeFileName = new StringBuffer(x.substring(0, x.indexOf(System.getProperty("microedition.locale"))));
completeFileName.append("en-US.properties");
in = getClass().getResourceAsStream(completeFileName.toString());
}
DataInputStream din = new DataInputStream(in);
StringBuffer line = new StringBuffer();
byte c;
while ((c = (byte)in.read()) != -1)
if (c != 10 && c != 13)
{
line.append(new String(new byte[] {
c
}));
} else
{
String aux = line.toString();
String key = aux.substring(0, aux.indexOf("=")).trim();
String message = aux.substring(aux.indexOf("=") + 1, aux.length());
line = new StringBuffer();
map.put(key, message);
}
}
public static final void init(String fileName)
throws IOException
{
if (instance == null)
instance = new ResourceBundle(fileName);
}
public static final ResourceBundle getInstance()
{
return instance;
}
public String getString(String key)
{
return (String)map.get(key);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -