APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.serializer

pack-priv Class WriterToASCI

extends Writer
implements WriterChain
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xml.internal.serializer.WriterChain
Imports
java.io.IOException, .OutputStream, .Writer

This class writes ASCII to a byte stream as quickly as possible. For the moment it does not do buffering, though I reserve the right to do some buffering down the line if I can prove that it will be faster even if the output stream is buffered. This class is only used internally within Xalan.

Field Summary

Modifier and TypeField and Description
private final OutputStream
m_os

The byte stream to write to.

Inherited from java.io.Writer:
lock

Constructor Summary

AccessConstructor and Description
public
WriterToASCI(OutputStream
The byte stream to write to.
os
)

Create an unbuffered ASCII writer.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.io.Writer.close.

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.close, java.io.Closeable.close.

Close the stream, flushing it first.

public void
public OutputStream

Returns:

reference to the result stream, or null of only a writer was set.
getOutputStream
()

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.getOutputStream.

Get the output stream where the events will be serialized to.

public Writer
getWriter()

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.getWriter.

Get the writer that this writer directly chains to.

public void
write(char[]
Array of characters
chars
,
int
Offset from which to start writing characters
start
,
int
Number of characters to write
length
)

Implements abstract java.io.Writer.write.

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.write.

Write a portion of an array of characters.

public void
write(int
int specifying a character to be written.
c
)

Overrides java.io.Writer.write.

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.write.

Write a single character.

public void
write(String
String to be written
s
)

Overrides java.io.Writer.write.

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.write.

Write a string.

Inherited from java.io.Writer:
appendappendappendnullWriterwritewrite

Field Detail

m_osback to summary
private final OutputStream m_os

The byte stream to write to.

Constructor Detail

WriterToASCIback to summary
public WriterToASCI(OutputStream os)

Create an unbuffered ASCII writer.

Parameters
os:OutputStream

The byte stream to write to.

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.io.Writer.close.

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.close, java.io.Closeable.close.

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

Exceptions
IOException:
If an I/O error occurs
flushback to summary
public void flush() throws IOException

Implements abstract java.io.Writer.flush.

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.flush, java.io.Flushable.flush.

Flush the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.

Exceptions
IOException:
If an I/O error occurs
getOutputStreamback to summary
public OutputStream getOutputStream()

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.getOutputStream.

Get the output stream where the events will be serialized to.

Returns:OutputStream

reference to the result stream, or null of only a writer was set.

getWriterback to summary
public Writer getWriter()

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.getWriter.

Get the writer that this writer directly chains to.

writeback to summary
public void write(char[] chars, int start, int length) throws IOException

Implements abstract java.io.Writer.write.

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.write.

Write a portion of an array of characters.

Parameters
chars:char[]

Array of characters

start:int

Offset from which to start writing characters

length:int

Number of characters to write

Exceptions
IOException:
If an I/O error occurs
writeback to summary
public void write(int c) throws IOException

Overrides java.io.Writer.write.

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.write.

Write a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored.

Subclasses that intend to support efficient single-character output should override this method.

Parameters
c:int

int specifying a character to be written.

Exceptions
IOException:
If an I/O error occurs
writeback to summary
public void write(String s) throws IOException

Overrides java.io.Writer.write.

Implements com.sun.org.apache.xml.internal.serializer.WriterChain.write.

Write a string.

Parameters
s:String

String to be written

Exceptions
IOException:
If an I/O error occurs