Methods Summary |
---|
public byte[] | getContent(java.io.ByteArrayInputStream bin)
ByteArrayOutputStream bout = new ByteArrayOutputStream();
skipWhitespace(bin);
int ch = readChar(bin);
while (ch != -1) {
bout.write(ch);
ch = readChar(bin);
}
return bout.toByteArray();
|
public java.lang.String | getLine(java.io.ByteArrayInputStream bin)
ByteArrayOutputStream bout = new ByteArrayOutputStream();
int ch = readChar(bin);
while (ch != '\n" && ch != '\r" && ch != -1) {
bout.write(ch);
ch = readChar(bin);
}
ch = readChar(bin);
if (ch != '\n") {
ungetChar(ch);
}
String line = new String(bout.toByteArray());
return line;
|
public java.lang.String | getStringToken(java.io.ByteArrayInputStream bin)
ByteArrayOutputStream bout = new ByteArrayOutputStream();
skipWhitespace(bin);
int ch = readChar(bin);
while (ch != '\n" && ch != '\r" && ch != -1) {
bout.write(ch);
ch = readChar(bin);
}
String token = new String(bout.toByteArray());
return token;
|
public java.lang.String | getToken(java.io.ByteArrayInputStream bin)
ByteArrayOutputStream bout = new ByteArrayOutputStream();
skipWhitespace(bin);
if (bin.available() > 0) {
int ch = readChar(bin);
while (ch != ' " && ch != '\n" && ch != '\r" && ch != -1) {
bout.write(ch);
ch = readChar(bin);
}
ungetChar(ch);
}
String token = new String(bout.toByteArray());
return token;
|
private void | init()
buffer = new Vector();
|
public int | readChar(java.io.ByteArrayInputStream bin)
int ch;
if (buffer.size() > 0) {
ch = ((Integer) buffer.elementAt(0)).intValue();
buffer.removeElementAt(0);
} else {
ch = bin.read();
}
return ch;
|
private void | skipWhitespace(java.io.ByteArrayInputStream bin)
int ch = readChar(bin);
while (ch == ' " || ch == '\n" || ch == '\r") {
ch = readChar(bin);
}
ungetChar(ch);
|
public void | ungetChar(int ch)
buffer.insertElementAt(new Integer(ch), 0);
|