Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ByteArrayInputReset {
- public static void main(String[] args) throws UnsupportedEncodingException {
- String tmp = "abc"; // - Проблема ТУТ
- byte buf[] = tmp.getBytes();
- ByteArrayInputStream in = new ByteArrayInputStream(buf);
- for (int i = 0; i < 2 ; i++) {
- int c;
- while ((c=in.read()) !=-1){
- if (i==0){
- System.out.print((char) c);
- }else {
- System.out.print(Character.toUpperCase((char)c));
- }
- }
- System.out.println();
- in.reset();
- }
- }
- }
- byte buf[] = tmp.getBytes("UTF-8"); - пробовал разные кодировки, не помогло
Add Comment
Please, Sign In to add comment