Here I create program with using bytearrayinputstream. Where we write file, but each byte will be in array. This is the code  :
import java.io.*;
public class Main {
   
    public static void main(String[] args) {
    String b="albert julius";
    byte [] ab=b.getBytes();
    ByteArrayInputStream a=new ByteArrayInputStream(ab,0,13);
    int c,i=0;
    while((c=a.read())!=-1)
    {
        if(i==0)
        {System.out.print((char) c);
        i++;
        }
        else
        {System.out.print(Character.toUpperCase((char)c));
         i--;
           }
    }
a.reset();
    }
}
ABOUT ME
Albert Julius. Powered by Blogger.
 RSS Feed
 RSS Feed Twitter
 Twitter
0 comments:
Post a Comment