( ), , ISO-8859-1 (8- ), , , 8- char ISO-8859-1.
InputStream.read(byte [] b) InputStream.read(byte [] b, intss, int len) .
public class OctetCharStream extends InputStream {
final private InputStream in;
static final private String charSet = "ISO-8859-1";
public OctetCharStream(InputStream in)
{
this.in=in;
}
@Override public int read() throws IOException {
return this.in.read();
}
public String readLine() throws IOException
{
StringBuilder sb = new StringBuilder();
while (true)
{
char c = (char) read();
if (c == '\n')
break;
sb.append(c);
}
return sb.toString();
}
public String readCharacters(int n) throws IOException
{
byte[] b = new byte[n];
int i = read(b);
String s = new String(b, 0, i, charSet);
return s;
}
}
, InputStreamReader, BufferedReader , InputStreamReader.read() , "" , . InputStreamReader InputStream InputStream, InputStreamReader /, .