@Override public void write(char[] cbuf, int off, int len) throws IOException { for (int i=0; i<len; i++) { write(cbuf[i+off]); } }
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)); } }
/** {@inheritDoc} */ @Override public void write(char[] cbuf, int off, int len) throws IOException { synchronized (lock) { while (len > 0) { write(cbuf[off]); off++; len--; } } }
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)); } }
@Override public void write(char[] cbuf, int off, int len) throws IOException { for (int i=0; i<len; i++) { write(cbuf[i+off]); } }
@Override public void write(String str, int off, int len) throws IOException { for (int i=0; i<len; i++) { write(str.charAt(i+off)); } }
/** {@inheritDoc} */ @Override public void write(String str, int off, int len) throws IOException { synchronized (lock) { while (len > 0) { write(str.charAt(off)); off++; len--; } } }
@Override public void write(String str, int off, int len) throws IOException { for (int i=0; i<len; i++) { write(str.charAt(i+off)); } }
private void writeIndent() throws IOException { for (int i=0; i<getIndent(); i++) { write(' '); } }
private void writeIndent() throws IOException { for (int i=0; i<getIndent(); i++) { write(' '); } }
writer.write("usage:"); writer.indent(2); writer.write(" "); writer.write(ExtendedCommands.commandName(jc)); for (ParameterDescription param : leafJc.getParameters()) { if (!param.getParameter().hidden()) { writer.write(" ["); writer.write(param.getParameter().getParameter().names()[0]); writer.write("]"); writer.write(" [<options>]"); writer.write(" [<command [<args>]]"); String[] argumentNames = ExtendedCommands.parameterArgumentNames(leafJc.getMainParameter()); if (argumentNames.length == 0) { writer.write(" <args>"); } else { String argumentName = argumentNames[0]; boolean writeAngleBrackets = !argumentName.startsWith("<") && !argumentName.startsWith("["); writer.write(" "); if (writeAngleBrackets) { writer.write("<"); writer.write(argumentNames[0]); if (writeAngleBrackets) { writer.write(">");