|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
org.apache.derbyTesting.functionTests.util.streams.LoopingAlphabetStream
public class LoopingAlphabetStream
A stream returning a cycle of the 26 lowercase letters of the modern Latin alphabet.
| Field Summary | |
|---|---|
private ByteAlphabet |
alphabet
|
private byte[] |
buffer
|
private long |
length
Length of the stream. |
private static int |
MAX_BUF_SIZE
Maximum size of buffer. |
private long |
remainingBlanks
Remaining bytes in the stream. |
private long |
remainingNonBlanks
|
private static byte |
SPACE
|
private int |
trailingBlanks
|
| Constructor Summary | |
|---|---|
LoopingAlphabetStream(long length)
Create a looping modern latin alphabet stream of the specified length. |
|
LoopingAlphabetStream(long length,
ByteAlphabet alphabet)
Create a looping alphabet of the specified type and length. |
|
LoopingAlphabetStream(long length,
ByteAlphabet alphabet,
int trailingBlanks)
|
|
LoopingAlphabetStream(long length,
int trailingBlanks)
Creates a looping alphabet stream with the specified length, in which the last characters are blanks. |
|
| Method Summary | |
|---|---|
int |
available()
Return remaining bytes in the stream. |
void |
closeStream()
|
private int |
fillBlanks(byte[] buf,
int off,
int length)
|
private void |
fillBuffer(int bufSize)
Fill internal buffer of bytes (from character sequence). |
void |
initStream()
|
int |
read()
|
int |
read(byte[] buf,
int off,
int length)
|
void |
reset()
Reset the stream. |
void |
resetStream()
|
| Methods inherited from class java.io.InputStream |
|---|
close, mark, markSupported, read, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int MAX_BUF_SIZE
private static final byte SPACE
private final long length
private final int trailingBlanks
private long remainingBlanks
private long remainingNonBlanks
private byte[] buffer
private final ByteAlphabet alphabet
| Constructor Detail |
|---|
public LoopingAlphabetStream(long length)
length - the number of characters (and also the number of bytes)
public LoopingAlphabetStream(long length,
int trailingBlanks)
length - total length of the streamtrailingBlanks - number of trailing blanks
public LoopingAlphabetStream(long length,
ByteAlphabet alphabet)
length - the number of bytes in the streamalphabet - the alphabet to loop over
public LoopingAlphabetStream(long length,
ByteAlphabet alphabet,
int trailingBlanks)
| Method Detail |
|---|
public int read()
read in class java.io.InputStream
public int read(byte[] buf,
int off,
int length)
read in class java.io.InputStreampublic void reset()
reset in class java.io.InputStreampublic int available()
available in class java.io.InputStreamprivate void fillBuffer(int bufSize)
bufSize - the wanted size, might be ignored if too big
private int fillBlanks(byte[] buf,
int off,
int length)
public void resetStream()
resetStream in interface org.apache.derby.iapi.types.Resetablepublic void initStream()
initStream in interface org.apache.derby.iapi.types.Resetablepublic void closeStream()
closeStream in interface org.apache.derby.iapi.types.Resetable
|
Built on Wed 2009-11-25 18:43:31-0800, from revision 884373 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||