Skip to main content
Skip table of contents

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
ReturnsName
voidClose()
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.
intRead(...)
Reads a single character.
voidUnread(...)
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]

Source code

public PushbackReader(TextReader inp, int size)
Arguments
TypeNameDescription
TextReaderinp
intsize
PushbackReader [2/2]

Source code

public PushbackReader(TextReader inp)
Arguments
TypeNameDescription
TextReaderinp
Summary

Creates a new pushback reader with a one-character pushback buffer.

Methods

Read [1/2]

Source code

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
NameDescription
IOExceptionIf an I/O error occurs
Read [2/2]

Source code

public override int Read(char[] cbuf, int off, int len)
Arguments
TypeNameDescription
char``[]cbufDestination buffer
intoffOffset at which to start writing characters
intlenMaximum 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
NameDescription
IOExceptionIf an I/O error occurs
Unread [1/3]

Source code

public virtual void Unread(int c)
Arguments
TypeNameDescription
intcThe 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
NameDescription
IOExceptionIf the pushback buffer is full,
or if some other I/O error occurs
Unread [2/3]

Source code

public virtual void Unread(char[] cbuf, int off, int len)
Arguments
TypeNameDescription
char``[]cbufCharacter array
intoffOffset of first character to push back
intlenNumber 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
NameDescription
IOExceptionIf there is insufficient room in the pushback
buffer, or if some other I/O error occurs
Unread [3/3]

Source code

public virtual void Unread(char[] cbuf)
Arguments
TypeNameDescription
char``[]cbufCharacter 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
NameDescription
IOExceptionIf there is insufficient room in the pushback
buffer, or if some other I/O error occurs
Close

Source code

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
NameDescription
IOExceptionIf an I/O error occurs

Generated with ModularDoc

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.