Java IO ByteArrayOutputStreamとByteArrayInputStream

import java.io.*;

public class Snipperts {
    
    
    public static void main(String[] args) throws IOException {
    
    
        String name="hello";
        InputStream inputStream=new ByteArrayInputStream(name.getBytes());
        OutputStream outputStream=new ByteArrayOutputStream();
        int data=0;
        byte dete[]=new byte[10];
        while((data=inputStream.read())!=-1){
    
    
            outputStream.write( Character.toUpperCase((char)data));
            outputStream.close();
            inputStream.close();
        }
        System.out.println(outputStream.toString());

    }
}

おすすめ

転載: blog.csdn.net/lyl140935/article/details/108587386