protected final class

XMLEntityManager.RewindableInputStream

extends InputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ org.apache.xerces.impl.XMLEntityManager.RewindableInputStream

Class Overview

This class wraps the byte inputstreams we're presented with. We need it because java.io.InputStreams don't provide functionality to reread processed bytes, and they have a habit of reading more than one character when you call their read() methods. This means that, once we discover the true (declared) encoding of a document, we can neither backtrack to read the whole doc again nor start reading where we are with a new reader. This class allows rewinding an inputStream by allowing a mark to be set, and the stream reset to that position. The class assumes that it needs to read one character per invocation when it's read() method is inovked, but uses the underlying InputStream's read(char[], offset length) method--it won't buffer data read this way!@xerces.internal

Summary

Public Constructors
XMLEntityManager.RewindableInputStream(InputStream is)
Public Methods
int available()
void close()
void mark(int howMuch)
boolean markSupported()
int read()
int read(byte[] b, int off, int len)
void reset()
void rewind()
void setStartOffset(int offset)
long skip(long n)
[Expand]
Inherited Methods
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable

Public Constructors

public XMLEntityManager.RewindableInputStream (InputStream is)

Public Methods

public int available ()

Throws
IOException

public void close ()

Throws
IOException

public void mark (int howMuch)

public boolean markSupported ()

public int read ()

Throws
IOException

public int read (byte[] b, int off, int len)

Throws
IOException

public void reset ()

public void rewind ()

public void setStartOffset (int offset)

public long skip (long n)

Throws
IOException