Top Description Fields Constructors Methods
org.hsqldb.lib

public Class AsciiOutputStream

extends OutputStream
Class Inheritance
Imports
java.io.IOException, .OutputStream, .Writer, java.util.Objects

An OutputStream that writes 7-bit US-ASCII values to a Writer, in compliance with the Java US_ASCII Charset decoder.

In particular, values greater than ASCII_MAX are written as NON_ASCII_REPLACEMENT.

Author
Campbell Burnet (campbell-burnet@users dot sourceforge.net)
Since
2.7.1
Version
2.7.1

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
ASCII_MASK

is 0b01111111

public static final int
ASCII_MAX

is 2^7 - 1 (127)

public static final int
NON_ASCII_MIN

is 2^7 (128)

public static final int
NON_ASCII_REPLACEMENT

is '�' (65533), the Unicode replacement character.

private final Writer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with this stream.

public void
flush()

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Flushes this output stream and forces any buffered output bytes to be written out.

public void
write(int b)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.

Inherited from java.io.OutputStream:
nullOutputStreamwritewrite

Field Detail

ASCII_BITSback to summary
public static final int ASCII_BITS

is 7;

ASCII_MASKback to summary
public static final int ASCII_MASK

is 0b01111111

ASCII_MAXback to summary
public static final int ASCII_MAX

is 2^7 - 1 (127)

NON_ASCII_MINback to summary
public static final int NON_ASCII_MIN

is 2^7 (128)

NON_ASCII_REPLACEMENTback to summary
public static final int NON_ASCII_REPLACEMENT

is '�' (65533), the Unicode replacement character. see https://www.fileformat.info/info/unicode/char/fffd/index.htm

writerback to summary
private final Writer writer

Constructor Detail

AsciiOutputStreamback to summary
public AsciiOutputStream(Writer writer)

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.OutputStream.close.

Closes this output stream and releases any system resources associated with this stream. The general contract of close is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
flushback to summary
public void flush() throws IOException

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Doc from java.io.OutputStream.flush.

Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.