public class DocumentReader extends Reader
Reader
for javax.swing.text.Document
objects.Constructor and Description |
---|
DocumentReader(Document document)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
This currently does nothing...
|
void |
mark(int readAheadLimit)
Marks the present position in the stream.
|
boolean |
markSupported()
Tells whether this reader supports the
mark operation. |
int |
read()
Reads the single character at the current position in the document.
|
int |
read(char[] array)
Read
array.length characters from the beginning
of the document into array . |
int |
read(char[] cbuf,
int off,
int len)
Reads characters into a portion of an array.
|
boolean |
ready()
Tells whether this reader is ready to be read without
blocking for input.
|
void |
reset()
Resets the stream.
|
void |
seek(long pos)
Move to the specified position in the document.
|
long |
skip(long n)
Skips characters.
|
public DocumentReader(Document document)
document
- The document we're 'reading'.public void close()
public void mark(int readAheadLimit)
reset()
will reposition the stream to this point.public boolean markSupported()
mark
operation.
This always returns true
for DocumentReader
.markSupported
in class Reader
public int read()
public int read(char[] array)
array.length
characters from the beginning
of the document into array
.public int read(char[] cbuf, int off, int len)
public boolean ready()
DocumentReader
will
always return true.public void reset()
public long skip(long n)
public void seek(long pos)
pos
is greater than the document's length, the stream's position is moved
to the end of the document.pos
- The position in the document to move to.Copyright © 2003–2015. All rights reserved.