public static void printWrappedString(@Nonnull PrintStream stream, @Nonnull String string, int maxWidth) { for (String str: wrapStringOnBreaks(string, maxWidth)) { stream.println(str); } } }
private static String[] addString(@Nonnull String[] arr, String str, int index, int newLength) { if (index >= arr.length) { arr = enlargeArray(arr, newLength); } arr[index] = str; return arr; }
public void write(String left, String right) throws IOException { leftLines = StringWrapper.wrapString(left, leftWidth, leftLines); rightLines = StringWrapper.wrapString(right, rightWidth, rightLines); int leftCount = leftLines.length; int rightCount = rightLines.length;
StringWrapper.printWrappedString(System.err, "Warning: You are disassembling an odex/oat file without deodexing it. You won't be able to " + "re-assemble the results unless you deodex it. See \"baksmali help deodex\"",
public void write(String left, String right) throws IOException { leftLines = StringWrapper.wrapString(left, leftWidth, leftLines); rightLines = StringWrapper.wrapString(right, rightWidth, rightLines); int leftCount = leftLines.length; int rightCount = rightLines.length;
StringWrapper.printWrappedString(System.err, "Warning: You are disassembling an odex/oat file without deodexing it. You won't be able to " + "re-assemble the results unless you deodex it. See \"baksmali help deodex\"",
public static void printWrappedString(@Nonnull PrintStream stream, @Nonnull String string, int maxWidth) { for (String str: wrapStringOnBreaks(string, maxWidth)) { stream.println(str); } } }
public void write(String left, String right) throws IOException { leftLines = StringWrapper.wrapString(left, leftWidth, leftLines); rightLines = StringWrapper.wrapString(right, rightWidth, rightLines); int leftCount = leftLines.length; int rightCount = rightLines.length;
private static String[] addString(@Nonnull String[] arr, String str, int index, int newLength) { if (index >= arr.length) { arr = enlargeArray(arr, newLength); } arr[index] = str; return arr; }
private void wrapLine() throws IOException { List<String> wrapped = Lists.newArrayList(StringWrapper.wrapStringOnBreaks(line.toString(), maxWidth)); out.write(wrapped.get(0), 0, wrapped.get(0).length()); out.write('\n'); line.replace(0, line.length(), ""); writeIndent(); for (int i=1; i<wrapped.size(); i++) { if (i > 1) { write('\n'); } write(wrapped.get(i)); } }
validateResult( new String[]{"abc", "abcdef", "abcdef"}, StringWrapper.wrapString("abc\nabcdefabcdef", 6, null)); StringWrapper.wrapString("abc", 6, new String[3])); StringWrapper.wrapString("abc", 6, new String[0])); StringWrapper.wrapString("abc", 6, new String[1])); StringWrapper.wrapString("", 6, new String[3])); StringWrapper.wrapString("abcdef", 6, new String[3])); StringWrapper.wrapString("abcdef\nabcdef", 6, new String[3])); StringWrapper.wrapString("abc\n\ndef", 6, new String[3])); StringWrapper.wrapString("\nabcdef", 6, new String[3])); StringWrapper.wrapString("\n\nabcdef", 6, new String[3])); StringWrapper.wrapString("\n\nabcdef", 6, new String[4])); StringWrapper.wrapString("\n\nabcdef\n\n", 6, new String[4])); StringWrapper.wrapString("\n\nabcdefa\n\n", 6, new String[4])); StringWrapper.wrapString("\n\nabcdefa\n\n", 6, new String[0]));
private static String[] addString(@Nonnull String[] arr, String str, int index, int newLength) { if (index >= arr.length) { arr = enlargeArray(arr, newLength); } arr[index] = str; return arr; }
private void wrapLine() throws IOException { List<String> wrapped = Lists.newArrayList(StringWrapper.wrapStringOnBreaks(line.toString(), maxWidth)); out.write(wrapped.get(0), 0, wrapped.get(0).length()); out.write('\n'); line.replace(0, line.length(), ""); writeIndent(); for (int i=1; i<wrapped.size(); i++) { if (i > 1) { write('\n'); } write(wrapped.get(i)); } }
private static String[] addString(@Nonnull String[] arr, String str, int index) { if (index >= arr.length) { arr = enlargeArray(arr, (int)(Math.ceil((arr.length + 1) * 1.5))); } arr[index] = str; return arr; }
public static void validateResult2(String[] expected, String textToWrap, int maxWidth) { List<String> result = Lists.newArrayList(StringWrapper.wrapStringOnBreaks(textToWrap, maxWidth)); Assert.assertEquals(expected.length, result.size()); int i; for (i=0; i<result.size(); i++) { Assert.assertTrue(i < expected.length); Assert.assertEquals(expected[i], result.get(i)); } } }
private static String[] addString(@Nonnull String[] arr, String str, int index) { if (index >= arr.length) { arr = enlargeArray(arr, (int)(Math.ceil((arr.length + 1) * 1.5))); } arr[index] = str; return arr; }
"the register types from incoming code paths that were merged"; Iterable<String> lines = StringWrapper.wrapStringOnBreaks(registerInfoHelp, ConsoleUtil.getConsoleWidth()); for (String line : lines) { "name. E.g. blah.oat/\"/blah/blah.dex\" or blah.oat/\"blah/blah.dex\" respectively."; Iterable<String> lines = StringWrapper.wrapStringOnBreaks(registerInfoHelp, ConsoleUtil.getConsoleWidth()); for (String line : lines) { "/tmp/framework"; Iterable<String> lines = StringWrapper.wrapStringOnBreaks(registerInfoHelp, ConsoleUtil.getConsoleWidth()); for (String line : lines) {