APIdia Launch Partner
Top Fields Constructors Methods
sun.nio.cs

public Class StreamDecoder

extends Reader
Class Inheritance
Imports
java.io.IOException, .InputStream, .UnsupportedEncodingException, .Reader, java.nio.ByteBuffer, .CharBuffer, java.nio.channels.FileChannel, .ReadableByteChannel, java.nio.charset.Charset, .CharsetDecoder, .CoderResult, .CodingErrorAction, .IllegalCharsetNameException, .UnsupportedCharsetException, java.util.Arrays

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private final ReadableByteChannel
private volatile boolean
private final Charset
private final CharsetDecoder
private static final int
private boolean
private final InputStream
private char
private static final int
Inherited from java.io.Reader:
lock

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Closes the stream and releases any system resources associated with it.

pack-priv String
private void
public void
public static StreamDecoder
forDecoder(ReadableByteChannel ch, CharsetDecoder dec, int minBufferCap)

public static StreamDecoder
public static StreamDecoder
public static StreamDecoder
public String
pack-priv void
pack-priv int
implRead(char[] cbuf, int off, int end)

pack-priv boolean
private boolean
private boolean
public int
read()

Overrides java.io.Reader.read.

Reads a single character.

public int
read(char[] cbuf, int offset, int length)

Implements abstract java.io.Reader.read.

Reads characters into a portion of an array.

private int
private int
public boolean
ready()

Overrides java.io.Reader.ready.

Tells whether this stream is ready to be read.

Inherited from java.io.Reader:
markmarkSupportednullReaderofreadreadreadAllAsStringreadAllLinesresetskiptransferTo

Field Detail

bbback to summary
private final ByteBuffer bb
chback to summary
private final ReadableByteChannel ch
closedback to summary
private volatile boolean closed
csback to summary
private final Charset cs
decoderback to summary
private final CharsetDecoder decoder
DEFAULT_BYTE_BUFFER_SIZEback to summary
private static final int DEFAULT_BYTE_BUFFER_SIZE
haveLeftoverCharback to summary
private boolean haveLeftoverChar
inback to summary
private final InputStream in
leftoverCharback to summary
private char leftoverChar
MIN_BYTE_BUFFER_SIZEback to summary
private static final int MIN_BYTE_BUFFER_SIZE

Constructor Detail

StreamDecoderback to summary
pack-priv StreamDecoder(InputStream in, Object lock, Charset cs)
StreamDecoderback to summary
pack-priv StreamDecoder(InputStream in, Object lock, CharsetDecoder dec)
StreamDecoderback to summary
pack-priv StreamDecoder(ReadableByteChannel ch, CharsetDecoder dec, int mbc)

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Doc from java.io.Reader.close.

Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.

Exceptions
IOException:
If an I/O error occurs
encodingNameback to summary
pack-priv String encodingName()
ensureOpenback to summary
private void ensureOpen() throws IOException
fillZeroToPositionback to summary
public void fillZeroToPosition() throws IOException
forDecoderback to summary
public static StreamDecoder forDecoder(ReadableByteChannel ch, CharsetDecoder dec, int minBufferCap)
forInputStreamReaderback to summary
public static StreamDecoder forInputStreamReader(InputStream in, Object lock, String charsetName) throws UnsupportedEncodingException
forInputStreamReaderback to summary
public static StreamDecoder forInputStreamReader(InputStream in, Object lock, Charset cs)
forInputStreamReaderback to summary
public static StreamDecoder forInputStreamReader(InputStream in, Object lock, CharsetDecoder dec)
getEncodingback to summary
public String getEncoding()
implCloseback to summary
pack-priv void implClose() throws IOException
implReadback to summary
pack-priv int implRead(char[] cbuf, int off, int end) throws IOException
implReadyback to summary
pack-priv boolean implReady()
inReadyback to summary
private boolean inReady()
isOpenback to summary
private boolean isOpen()
readback to summary
public int read() throws IOException

Overrides java.io.Reader.read.

Doc from java.io.Reader.read.

Reads a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.

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

Exceptions
IOException:
If an I/O error occurs
readback to summary
public int read(char[] cbuf, int offset, int length) throws IOException

Implements abstract java.io.Reader.read.

Doc from java.io.Reader.read.

Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

If len is zero, then no characters are read and 0 is returned; otherwise, there is an attempt to read at least one character. If no character is available because the stream is at its end, the value -1 is returned; otherwise, at least one character is read and stored into cbuf.

Exceptions
IOException:
If an I/O error occurs
read0back to summary
private int read0() throws IOException
Annotations
@SuppressWarnings:fallthrough
readBytesback to summary
private int readBytes() throws IOException
readyback to summary
public boolean ready() throws IOException

Overrides java.io.Reader.ready.

Doc from java.io.Reader.ready.

Tells whether this stream is ready to be read.

Exceptions
IOException:
If an I/O error occurs