Methods Summary |
---|
public static java.lang.String | markRead(java.io.InputStream a, int x, int y)reads characters from a InputStream, skips back y characters and continues
reading from that new position up to the end.
int m = 0;
int r;
StringBuilder builder = new StringBuilder();
do {
m++;
r = a.read();
if (m == x)
a.mark((x + y));
if (m == (x + y))
a.reset();
if (r != -1)
builder.append((char) r);
} while (r != -1);
return builder.toString();
|
public static java.lang.String | markRead(java.io.Reader a, int x, int y)reads characters from a reader, skips back y characters and continues
reading from that new position up to the end.
int m = 0;
int r;
StringBuilder builder = new StringBuilder();
do {
m++;
r = a.read();
if (m == x)
a.mark((x + y));
if (m == (x + y))
a.reset();
if (r != -1)
builder.append((char) r);
} while (r != -1);
return builder.toString();
|
public static java.lang.String | read(java.io.InputStream a)returns the content of an InputStream as a String.
int r;
StringBuilder builder = new StringBuilder();
do {
r = a.read();
if (r != -1)
builder.append((char) r);
} while (r != -1);
return builder.toString();
|
public static java.lang.String | read(java.io.Reader a)reads characters from a reader and returns them as a string.
int r;
StringBuilder builder = new StringBuilder();
do {
r = a.read();
if (r != -1)
builder.append((char) r);
} while (r != -1);
return builder.toString();
|
public static java.lang.String | read(java.io.InputStream a, int x)returns the content of an InputStream as a String. It reads x characters.
byte[] b = new byte[x];
int len = a.read(b, 0, x);
if (len < 0) {
return "";
}
return new String(b, 0, len);
|
public static java.lang.String | read(java.io.Reader a, int x)reads a number of characters from a reader and returns them as a string.
char[] b = new char[x];
int len = a.read(b, 0, x);
if (len < 0) {
return "";
}
return new String(b, 0, len);
|
public static java.lang.String | skipRead(java.io.InputStream a)returns the content of the input stream as a String. It only appends
every second character.
int r;
StringBuilder builder = new StringBuilder();
do {
a.skip(1);
r = a.read();
if (r != -1)
builder.append((char) r);
} while (r != -1);
return builder.toString();
|
public static java.lang.String | skipRead(java.io.Reader a)reads every second characters from a reader and returns them as a string.
int r;
StringBuilder builder = new StringBuilder();
do {
a.skip(1);
r = a.read();
if (r != -1)
builder.append((char) r);
} while (r != -1);
return builder.toString();
|