Replaced qualified names with simple names.
This commit is contained in:
@@ -43,7 +43,7 @@ public class ByteReader
|
||||
|
||||
public static int readUInt(ByteBuffer buffer)
|
||||
{
|
||||
return ByteReader.readInt(buffer);
|
||||
return readInt(buffer);
|
||||
}
|
||||
|
||||
public static short readShort(ByteBuffer buffer)
|
||||
@@ -135,12 +135,12 @@ public class ByteReader
|
||||
{
|
||||
a = "0" + a;
|
||||
}
|
||||
return a + ByteReader.readRGB(buffer);
|
||||
return a + readRGB(buffer);
|
||||
}
|
||||
|
||||
public static String readUtfString(ByteBuffer buffer, boolean isRaw) throws Exception
|
||||
{
|
||||
int size = ByteReader.readInt(buffer);
|
||||
int size = readInt(buffer);
|
||||
if (size <= 0)
|
||||
{
|
||||
return "";
|
||||
@@ -162,19 +162,19 @@ public class ByteReader
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ByteReader.checkAndReplaceNewLine(isRaw, new String(new String(bytes, "Unicode").getBytes("UTF-8"), "UTF-8"));
|
||||
return checkAndReplaceNewLine(isRaw, new String(new String(bytes, "Unicode").getBytes("UTF-8"), "UTF-8"));
|
||||
}
|
||||
|
||||
public static String readString(ByteBuffer input, boolean isRaw) throws IOException
|
||||
{
|
||||
int len = ByteReader.readCompactInt(input);
|
||||
int len = readCompactInt(input);
|
||||
if (len == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
byte[] bytes = new byte[len > 0 ? len : -2 * len];
|
||||
input.get(bytes);
|
||||
return ByteReader.checkAndReplaceNewLine(isRaw, new String(bytes, 0, bytes.length - (len > 0 ? 1 : 2), len > 0 ? defaultCharset : utf16leCharset).intern());
|
||||
return checkAndReplaceNewLine(isRaw, new String(bytes, 0, bytes.length - (len > 0 ? 1 : 2), len > 0 ? defaultCharset : utf16leCharset).intern());
|
||||
}
|
||||
|
||||
private static String checkAndReplaceNewLine(boolean isRaw, String str)
|
||||
|
@@ -36,7 +36,7 @@ public class ByteWriter
|
||||
|
||||
public static Buffer writeCompactInt(int count)
|
||||
{
|
||||
byte[] b = ByteWriter.compactIntToByteArray(count);
|
||||
byte[] b = compactIntToByteArray(count);
|
||||
ByteBuffer buffer = ByteBuffer.allocate(b.length).order(BYTE_ORDER);
|
||||
buffer.put(b);
|
||||
return buffer;
|
||||
@@ -97,7 +97,7 @@ public class ByteWriter
|
||||
public static Buffer writeRGBA(String rgba)
|
||||
{
|
||||
ByteBuffer buffer = ByteBuffer.allocate(4).order(BYTE_ORDER);
|
||||
buffer.put((byte[]) ByteWriter.writeRGB(rgba.substring(0, 6)).array());
|
||||
buffer.put((byte[]) writeRGB(rgba.substring(0, 6)).array());
|
||||
buffer.put((byte) Integer.parseInt(rgba.substring(6, 8), 16));
|
||||
return buffer;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class ByteWriter
|
||||
}
|
||||
if (!isRaw)
|
||||
{
|
||||
str = ByteWriter.checkAndReplaceNewLine(str);
|
||||
str = checkAndReplaceNewLine(str);
|
||||
size = str.length();
|
||||
}
|
||||
ByteBuffer buffer = ByteBuffer.allocate((size * 2) + 4).order(BYTE_ORDER);
|
||||
@@ -127,16 +127,16 @@ public class ByteWriter
|
||||
{
|
||||
if ((s == null) || s.isEmpty())
|
||||
{
|
||||
return ByteWriter.writeCompactInt(0);
|
||||
return writeCompactInt(0);
|
||||
}
|
||||
if (!isRaw)
|
||||
{
|
||||
s = ByteWriter.checkAndReplaceNewLine(s);
|
||||
s = checkAndReplaceNewLine(s);
|
||||
}
|
||||
s = s + '\u0000';
|
||||
boolean def = defaultCharset.newEncoder().canEncode(s);
|
||||
byte[] bytes = s.getBytes(def ? defaultCharset : utf16leCharset);
|
||||
byte[] bSize = ByteWriter.compactIntToByteArray(def ? bytes.length : (-bytes.length) / 2);
|
||||
byte[] bSize = compactIntToByteArray(def ? bytes.length : (-bytes.length) / 2);
|
||||
ByteBuffer buffer = ByteBuffer.allocate(bytes.length + bSize.length).order(BYTE_ORDER);
|
||||
buffer.put(bSize);
|
||||
buffer.put(bytes);
|
||||
|
@@ -75,9 +75,9 @@ public class Util
|
||||
{
|
||||
if ((counter % 16) == 0)
|
||||
{
|
||||
result.append(Util.fillHex(i, 4) + ": ");
|
||||
result.append(fillHex(i, 4) + ": ");
|
||||
}
|
||||
result.append(Util.fillHex(data[i] & 255, 2) + " ");
|
||||
result.append(fillHex(data[i] & 255, 2) + " ");
|
||||
if (++counter != 16)
|
||||
{
|
||||
continue;
|
||||
@@ -130,7 +130,7 @@ public class Util
|
||||
|
||||
public static String printData(byte[] blop)
|
||||
{
|
||||
return Util.printData(blop, blop.length);
|
||||
return printData(blop, blop.length);
|
||||
}
|
||||
|
||||
public static List<File> loadFiles(String dir, String prefix)
|
||||
@@ -225,7 +225,7 @@ public class Util
|
||||
{
|
||||
byte[] data = new byte[buf.remaining()];
|
||||
buf.get(data);
|
||||
String hex = Util.printData(data, data.length);
|
||||
String hex = printData(data, data.length);
|
||||
buf.position(buf.position() - data.length);
|
||||
return hex;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ public class Util
|
||||
DiagnosticCollector diagnostics = new DiagnosticCollector();
|
||||
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
||||
StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);
|
||||
Iterable<? extends JavaFileObject> compilationUnit = fileManager.getJavaFileObjectsFromFiles(Util.loadFiles(sourceFile, ".java"));
|
||||
Iterable<? extends JavaFileObject> compilationUnit = fileManager.getJavaFileObjectsFromFiles(loadFiles(sourceFile, ".java"));
|
||||
JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnit);
|
||||
if (!task.call().booleanValue())
|
||||
{
|
||||
|
Reference in New Issue
Block a user