Top Description Fields Constructors Methods
org.apache.commons.io.output

public Class ProxyWriter

extends FilterWriter
Class Inheritance
Imports
java.io.IOException, .FilterWriter, .Writer

A Proxy stream which acts as expected, that is it passes the method calls on to the proxied stream and doesn't change which methods are being called. It is an alternative base class to FilterWriter to increase reusability, because FilterWriter changes the methods being called, such as write(char[]) to write(char[], int, int) and write(String) to write(String, int, int).
Author
Stephen Colebourne
Version
$Id: ProxyWriter.java 471628 2006-11-06 04:06:45Z bayard $

Field Summary

Inherited from java.io.FilterWriter:
out

Constructor Summary

AccessConstructor and Description
public
ProxyWriter(Writer
the Writer to delegate to
proxy
)

Constructs a new ProxyWriter.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterWriter.close.

Implements java.io.Closeable.close.

Closes the stream, flushing it first.
public void
flush()

Overrides java.io.FilterWriter.flush.

Implements java.io.Flushable.flush.

Flushes the stream.
public void
write(int
int specifying a character to be written
idx
)

Overrides java.io.FilterWriter.write.

Writes a single character.
public void
write(char[]
Array of characters to be written
chr
)

Overrides java.io.Writer.write.

Writes an array of characters.
public void
write(char[]
Buffer of characters to be written
chr
,
int
Offset from which to start reading characters
st
,
int
Number of characters to be written
end
)

Overrides java.io.FilterWriter.write.

Writes a portion of an array of characters.
public void
write(String
String to be written
str
)

Overrides java.io.Writer.write.

Writes a string.
public void
write(String
String to be written
str
,
int
Offset from which to start reading characters
st
,
int
Number of characters to be written
end
)

Overrides java.io.FilterWriter.write.

Writes a portion of a string.

Constructor Detail

ProxyWriterback to summary
public ProxyWriter(Writer proxy)

Constructs a new ProxyWriter.

Parameters
proxy:Writer

the Writer to delegate to

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterWriter.close.

Implements java.io.Closeable.close.

Doc from java.io.Writer.close.

Closes the stream, flushing it first. Once the stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.

Exceptions
IOException:
If an I/O error occurs
See Also
java.io.Writer#close()
flushback to summary
public void flush() throws IOException

Overrides java.io.FilterWriter.flush.

Implements java.io.Flushable.flush.

Doc from java.io.FilterWriter.flush.

Flushes the stream.

Exceptions
IOException:
If an I/O error occurs
See Also
java.io.Writer#flush()
writeback to summary
public void write(int idx) throws IOException

Overrides java.io.FilterWriter.write.

Doc from java.io.FilterWriter.write.

Writes a single character.

Parameters
idx:int

Doc from java.io.Writer.write.

int specifying a character to be written

Exceptions
IOException:
If an I/O error occurs
See Also
java.io.Writer#write(int)
writeback to summary
public void write(char[] chr) throws IOException

Overrides java.io.Writer.write.

Doc from java.io.Writer.write.

Writes an array of characters.

Parameters
chr:char[]

Array of characters to be written

Exceptions
IOException:
If an I/O error occurs
See Also
java.io.Writer#write(char[])
writeback to summary
public void write(char[] chr, int st, int end) throws IOException

Overrides java.io.FilterWriter.write.

Doc from java.io.FilterWriter.write.

Writes a portion of an array of characters.

Parameters
chr:char[]

Buffer of characters to be written

st:int

Offset from which to start reading characters

end:int

Number of characters to be written

Exceptions
IOException:
If an I/O error occurs
See Also
java.io.Writer#write(char[], int, int)
writeback to summary
public void write(String str) throws IOException

Overrides java.io.Writer.write.

Doc from java.io.Writer.write.

Writes a string.

Parameters
str:String

String to be written

Exceptions
IOException:
If an I/O error occurs
See Also
java.io.Writer#write(String)
writeback to summary
public void write(String str, int st, int end) throws IOException

Overrides java.io.FilterWriter.write.

Doc from java.io.FilterWriter.write.

Writes a portion of a string.

Parameters
str:String

String to be written

st:int

Offset from which to start reading characters

end:int

Number of characters to be written

Exceptions
IOException:
If an I/O error occurs
See Also
java.io.Writer#write(String, int, int)