Top Constructors Methods
org.apache.sshd.common.util.io.output

public Class NullPrintStream

extends PrintStream
Class Inheritance
Imports
java.io.PrintStream, java.util.Locale

Author
Apache MINA SSHD Project

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PrintStream
append(CharSequence
The character sequence to append. If csq is null, then the four characters "null" are appended to this output stream.
csq
)

Overrides java.io.PrintStream.append.

Implements java.lang.Appendable.append.

Appends the specified character sequence to this output stream.

public PrintStream
append(CharSequence
The character sequence from which a subsequence will be appended. If csq is null, then characters will be appended as if csq contained the four characters "null".
csq
,
int
The index of the first character in the subsequence
start
,
int
The index of the character following the last character in the subsequence
end
)

Overrides java.io.PrintStream.append.

Implements java.lang.Appendable.append.

Appends a subsequence of the specified character sequence to this output stream.

public PrintStream
append(char
The 16-bit character to append
c
)

Overrides java.io.PrintStream.append.

Implements java.lang.Appendable.append.

Appends the specified character to this output stream.

public PrintStream
format(String
A format string as described in Format string syntax
format
,
Object...
Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
args
)

Overrides java.io.PrintStream.format.

Writes a formatted string to this output stream using the specified format string and arguments.

public PrintStream
format(Locale
The locale to apply during formatting. If l is null then no localization is applied.
l
,
String
A format string as described in Format string syntax
format
,
Object...
Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
args
)

Overrides java.io.PrintStream.format.

Writes a formatted string to this output stream using the specified format string and arguments.

public PrintStream
printf(String
A format string as described in Format string syntax
format
,
Object...
Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
args
)

Overrides java.io.PrintStream.printf.

A convenience method to write a formatted string to this output stream using the specified format string and arguments.

public PrintStream
printf(Locale
The locale to apply during formatting. If l is null then no localization is applied.
l
,
String
A format string as described in Format string syntax
format
,
Object...
Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
args
)

Overrides java.io.PrintStream.printf.

A convenience method to write a formatted string to this output stream using the specified format string and arguments.

public void
println()

Overrides java.io.PrintStream.println.

Terminates the current line by writing the line separator string.

public void
println(boolean
The boolean to be printed
x
)

Overrides java.io.PrintStream.println.

Prints a boolean and then terminates the line.

public void
println(char
The char to be printed.
x
)

Overrides java.io.PrintStream.println.

Prints a character and then terminates the line.

public void
println(int
The int to be printed.
x
)

Overrides java.io.PrintStream.println.

Prints an integer and then terminates the line.

public void
println(long
a The long to be printed.
x
)

Overrides java.io.PrintStream.println.

Prints a long and then terminates the line.

public void
println(float
The float to be printed.
x
)

Overrides java.io.PrintStream.println.

Prints a float and then terminates the line.

public void
println(double
The double to be printed.
x
)

Overrides java.io.PrintStream.println.

Prints a double and then terminates the line.

public void
println(char[]
an array of chars to print.
x
)

Overrides java.io.PrintStream.println.

Prints an array of characters and then terminates the line.

public void
println(String
The String to be printed.
x
)

Overrides java.io.PrintStream.println.

Prints a String and then terminates the line.

public void
println(Object
The Object to be printed.
x
)

Overrides java.io.PrintStream.println.

Prints an Object and then terminates the line.

public void
write(int
The byte to be written
b
)

Overrides java.io.PrintStream.write.

Writes the specified byte to this stream.

public void
write(byte[]
A byte array
buf
,
int
Offset from which to start taking bytes
off
,
int
Number of bytes to write
len
)

Overrides java.io.PrintStream.write.

Writes len bytes from the specified byte array starting at offset off to this stream.

Inherited from java.io.PrintStream:
charsetcheckErrorclearErrorcloseflushsetErrorwritewriteBytes

Constructor Detail

NullPrintStreamback to summary
public NullPrintStream()

Method Detail

appendback to summary
public PrintStream append(CharSequence csq)

Overrides java.io.PrintStream.append.

Implements java.lang.Appendable.append.

Doc from java.io.PrintStream.append.

Appends the specified character sequence to this output stream.

An invocation of this method of the form out.append(csq) when csq is not null, behaves in exactly the same way as the invocation

out.print(csq.toString())
out.print(csq.toString())

Depending on the specification of toString for the character sequence csq, the entire sequence may not be appended. For instance, invoking the toString method of a character buffer will return a subsequence whose content depends upon the buffer's position and limit.

Parameters
csq:CharSequence

The character sequence to append. If csq is null, then the four characters "null" are appended to this output stream.

Returns:PrintStream

This output stream

Annotations
@Override
appendback to summary
public PrintStream append(CharSequence csq, int start, int end)

Overrides java.io.PrintStream.append.

Implements java.lang.Appendable.append.

Doc from java.io.PrintStream.append.

Appends a subsequence of the specified character sequence to this output stream.

An invocation of this method of the form out.append(csq, start, end) when csq is not null, behaves in exactly the same way as the invocation

out.print(csq.subSequence(start, end).toString())
out.print(csq.subSequence(start, end).toString())
Parameters
csq:CharSequence

The character sequence from which a subsequence will be appended. If csq is null, then characters will be appended as if csq contained the four characters "null".

start:int

The index of the first character in the subsequence

end:int

The index of the character following the last character in the subsequence

Returns:PrintStream

This output stream

Annotations
@Override
appendback to summary
public PrintStream append(char c)

Overrides java.io.PrintStream.append.

Implements java.lang.Appendable.append.

Doc from java.io.PrintStream.append.

Appends the specified character to this output stream.

An invocation of this method of the form out.append(c) behaves in exactly the same way as the invocation

out.print(c)
out.print(c)
Parameters
c:char

The 16-bit character to append

Returns:PrintStream

This output stream

Annotations
@Override
formatback to summary
public PrintStream format(String format, Object... args)

Overrides java.io.PrintStream.format.

Doc from java.io.PrintStream.format.

Writes a formatted string to this output stream using the specified format string and arguments.

The locale always used is the one returned by java.util.Locale#getDefault(Locale.Category) with FORMAT category specified, regardless of any previous invocations of other formatting methods on this object.

Parameters
format:String

A format string as described in Format string syntax

args:Object[]

Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.

Returns:PrintStream

This output stream

Annotations
@Override
formatback to summary
public PrintStream format(Locale l, String format, Object... args)

Overrides java.io.PrintStream.format.

Doc from java.io.PrintStream.format.

Writes a formatted string to this output stream using the specified format string and arguments.

Parameters
l:Locale

The locale to apply during formatting. If l is null then no localization is applied.

format:String

A format string as described in Format string syntax

args:Object[]

Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.

Returns:PrintStream

This output stream

Annotations
@Override
printfback to summary
public PrintStream printf(String format, Object... args)

Overrides java.io.PrintStream.printf.

Doc from java.io.PrintStream.printf.

A convenience method to write a formatted string to this output stream using the specified format string and arguments.

An invocation of this method of the form out.printf(format, args) behaves in exactly the same way as the invocation

out.format(format, args)
out.format(format, args)
Parameters
format:String

A format string as described in Format string syntax

args:Object[]

Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.

Returns:PrintStream

This output stream

Annotations
@Override
printfback to summary
public PrintStream printf(Locale l, String format, Object... args)

Overrides java.io.PrintStream.printf.

Doc from java.io.PrintStream.printf.

A convenience method to write a formatted string to this output stream using the specified format string and arguments.

An invocation of this method of the form out.printf(l, format, args) behaves in exactly the same way as the invocation

out.format(l, format, args)
out.format(l, format, args)
Parameters
l:Locale

The locale to apply during formatting. If l is null then no localization is applied.

format:String

A format string as described in Format string syntax

args:Object[]

Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.

Returns:PrintStream

This output stream

Annotations
@Override
printlnback to summary
public void println()

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Terminates the current line by writing the line separator string. The line separator string is defined by the system property line.separator, and is not necessarily a single newline character ('\n').

Annotations
@Override
printlnback to summary
public void println(boolean x)

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Prints a boolean and then terminates the line. This method behaves as though it invokes print(boolean) and then println().

Parameters
x:boolean

The boolean to be printed

Annotations
@Override
printlnback to summary
public void println(char x)

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Prints a character and then terminates the line. This method behaves as though it invokes print(char) and then println().

Parameters
x:char

The char to be printed.

Annotations
@Override
printlnback to summary
public void println(int x)

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Prints an integer and then terminates the line. This method behaves as though it invokes print(int) and then println().

Parameters
x:int

The int to be printed.

Annotations
@Override
printlnback to summary
public void println(long x)

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Prints a long and then terminates the line. This method behaves as though it invokes print(long) and then println().

Parameters
x:long

a The long to be printed.

Annotations
@Override
printlnback to summary
public void println(float x)

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Prints a float and then terminates the line. This method behaves as though it invokes print(float) and then println().

Parameters
x:float

The float to be printed.

Annotations
@Override
printlnback to summary
public void println(double x)

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Prints a double and then terminates the line. This method behaves as though it invokes print(double) and then println().

Parameters
x:double

The double to be printed.

Annotations
@Override
printlnback to summary
public void println(char[] x)

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Prints an array of characters and then terminates the line. This method behaves as though it invokes print(char[]) and then println().

Parameters
x:char[]

an array of chars to print.

Annotations
@Override
printlnback to summary
public void println(String x)

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Prints a String and then terminates the line. This method behaves as though it invokes print(String) and then println().

Parameters
x:String

The String to be printed.

Annotations
@Override
printlnback to summary
public void println(Object x)

Overrides java.io.PrintStream.println.

Doc from java.io.PrintStream.println.

Prints an Object and then terminates the line. This method calls at first String.valueOf(x) to get the printed object's string value, then behaves as though it invokes print(String) and then println().

Parameters
x:Object

The Object to be printed.

Annotations
@Override
writeback to summary
public void write(int b)

Overrides java.io.PrintStream.write.

Doc from java.io.PrintStream.write.

Writes the specified byte to this stream. If the byte is a newline and automatic flushing is enabled then the flush method will be invoked on the underlying output stream.

Note that the byte is written as given; to write a character that will be translated according to the default charset, use the print(char) or println(char) methods.

Parameters
b:int

The byte to be written

Annotations
@Override
writeback to summary
public void write(byte[] buf, int off, int len)

Overrides java.io.PrintStream.write.

Doc from java.io.PrintStream.write.

Writes len bytes from the specified byte array starting at offset off to this stream. If automatic flushing is enabled then the flush method will be invoked on the underlying output stream.

Note that the bytes will be written as given; to write characters that will be translated according to the default charset, use the print(char) or println(char) methods.

Parameters
buf:byte[]

A byte array

off:int

Offset from which to start taking bytes

len:int

Number of bytes to write

Annotations
@Override