Top Description Fields Constructors Methods
org.glassfish.tyrus.core

pack-priv Class BufferedStringReader

extends Reader
Class Inheritance
Imports
java.io.IOException, .Reader

Passed to the (@link MessageHandler.Whole} in case that partial messages are being received.
Authors
Danny Coward, Stepan Kopriva

Field Summary

Modifier and TypeField and Description
private final ReaderBuffer
Inherited from java.io.Reader:
lock

Constructor Summary

AccessConstructor and Description
public
BufferedStringReader(ReaderBuffer
underlying buffer.
readerBuffer
)

Constructor.

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.

public int
read(char[]
Destination buffer
destination
,
int
Offset at which to start storing characters
offsetToStart
,
int
Maximum number of characters to read
numberOfChars
)

Implements abstract java.io.Reader.read.

Reads characters into a portion of an array.

Inherited from java.io.Reader:
markmarkSupportednullReaderreadreadreadreadyresetskiptransferTo

Field Detail

readerBufferback to summary
private final ReaderBuffer readerBuffer

Constructor Detail

BufferedStringReaderback to summary
public BufferedStringReader(ReaderBuffer readerBuffer)

Constructor.

Parameters
readerBuffer:ReaderBuffer

underlying buffer.

Method Detail

closeback to summary
public void close()

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.

Annotations
@Override
readback to summary
public int read(char[] destination, int offsetToStart, int numberOfChars) 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.

Parameters
destination:char[]

Destination buffer

offsetToStart:int

Offset at which to start storing characters

numberOfChars:int

Maximum number of characters to read

Returns:int

The number of characters read, or -1 if the end of the stream has been reached

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs