PushbackReader
PushbackReader Public class
Description
A character-stream reader that allows characters to be pushed back into the stream.
@author Mark Reinhold
@since JDK1.1
Diagram
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph iTextSharp.xmp.impl
iTextSharp.xmp.impl.PushbackReader[[PushbackReader]]
iTextSharp.xmp.impl.FilterReader[[FilterReader]]
class iTextSharp.xmp.impl.FilterReader abstractStyle;
end
iTextSharp.xmp.impl.FilterReader --> iTextSharp.xmp.impl.PushbackReader
Members
Methods
Public methods
Returns | Name |
---|---|
void | Close ()Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), unread(), ready(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect. |
int | Read (... )Reads a single character. |
void | Unread (... )Pushes back a single character by copying it to the front of the pushback buffer. After this method returns, the next character to be read will have the value ... |
Details
Summary
A character-stream reader that allows characters to be pushed back into the stream.
@author Mark Reinhold
@since JDK1.1
Inheritance
Constructors
PushbackReader [1/2]
public PushbackReader(TextReader inp, int size)
Arguments
Type | Name | Description |
---|---|---|
TextReader | inp | |
int | size |
PushbackReader [2/2]
public PushbackReader(TextReader inp)
Arguments
Type | Name | Description |
---|---|---|
TextReader | inp |
Summary
Creates a new pushback reader with a one-character pushback buffer.
Methods
Read [1/2]
public override int Read()
Summary
Reads a single character.
Returns
The character read, or -1 if the end of the stream has been reached
Exceptions
Name | Description |
---|---|
IOException | If an I/O error occurs |
Read [2/2]
public override int Read(char[] cbuf, int off, int len)
Arguments
Type | Name | Description |
---|---|---|
char``[] | cbuf | Destination buffer |
int | off | Offset at which to start writing characters |
int | len | Maximum number of characters to read |
Summary
Reads characters into a portion of an array.
Returns
The number of characters read, or -1 if the end of the stream has been reached
Exceptions
Name | Description |
---|---|
IOException | If an I/O error occurs |
Unread [1/3]
public virtual void Unread(int c)
Arguments
Type | Name | Description |
---|---|---|
int | c | The int value representing a character to be pushed back |
Summary
Pushes back a single character by copying it to the front of the pushback buffer. After this method returns, the next character to be read will have the value
(char)c
Exceptions
Name | Description |
---|---|
IOException | If the pushback buffer is full, or if some other I/O error occurs |
Unread [2/3]
public virtual void Unread(char[] cbuf, int off, int len)
Arguments
Type | Name | Description |
---|---|---|
char``[] | cbuf | Character array |
int | off | Offset of first character to push back |
int | len | Number of characters to push back |
Summary
Pushes back a portion of an array of characters by copying it to the front of the pushback buffer. After this method returns, the next character to be read will have the value
cbuf[off]
, the character after that will have the value
cbuf[off+1]
Exceptions
Name | Description |
---|---|
IOException | If there is insufficient room in the pushback buffer, or if some other I/O error occurs |
Unread [3/3]
public virtual void Unread(char[] cbuf)
Arguments
Type | Name | Description |
---|---|---|
char``[] | cbuf | Character array to push back |
Summary
Pushes back an array of characters by copying it to the front of the pushback buffer. After this method returns, the next character to be read will have the value
cbuf[0]
, the character after that will have the value
cbuf[1]
Exceptions
Name | Description |
---|---|
IOException | If there is insufficient room in the pushback buffer, or if some other I/O error occurs |
Close
public override void Close()
Summary
Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), unread(), ready(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.
Exceptions
Name | Description |
---|---|
IOException | If an I/O error occurs |
Generated with ModularDoc