mirror of
https://github.com/corda/corda.git
synced 2025-01-04 04:04:27 +00:00
add PrintStream.print[ln] overloads for primitives and char arrays
This commit is contained in:
parent
9c36105b8f
commit
51c56c1b3c
@ -39,10 +39,34 @@ public class PrintStream extends OutputStream {
|
||||
print(String.valueOf(o));
|
||||
}
|
||||
|
||||
public void print(boolean v) {
|
||||
print(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void print(char c) {
|
||||
print(String.valueOf(c));
|
||||
}
|
||||
|
||||
public void print(int v) {
|
||||
print(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void print(long v) {
|
||||
print(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void print(float v) {
|
||||
print(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void print(double v) {
|
||||
print(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void print(char[] s) {
|
||||
print(String.valueOf(s));
|
||||
}
|
||||
|
||||
public synchronized void println(String s) {
|
||||
try {
|
||||
out.write(s.getBytes());
|
||||
@ -62,9 +86,33 @@ public class PrintStream extends OutputStream {
|
||||
println(String.valueOf(o));
|
||||
}
|
||||
|
||||
public void println(boolean v) {
|
||||
println(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void println(char c) {
|
||||
println(String.valueOf(c));
|
||||
}
|
||||
|
||||
public void println(int v) {
|
||||
println(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void println(long v) {
|
||||
println(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void println(float v) {
|
||||
println(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void println(double v) {
|
||||
println(String.valueOf(v));
|
||||
}
|
||||
|
||||
public void println(char[] s) {
|
||||
println(String.valueOf(s));
|
||||
}
|
||||
|
||||
public void write(int c) throws IOException {
|
||||
out.write(c);
|
||||
|
@ -227,5 +227,13 @@ public class Misc {
|
||||
}
|
||||
|
||||
System.out.println(new java.util.Date().toString());
|
||||
|
||||
System.out.println('x');
|
||||
System.out.println(true);
|
||||
System.out.println(42);
|
||||
System.out.println(123456789012345L);
|
||||
System.out.println(75.62);
|
||||
System.out.println(75.62d);
|
||||
System.out.println(new char[] { 'h', 'i' });
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user