BYTEARRAYOUTPUTSTREAM (byte array output stream) example

xiaoxiao2021-04-03  226

// Demonstrate ByteArrayOutputStream.import java.io *;. Class ByteArrayOutputStreamDemo {public static void main (String [] args) throws IOException {ByteArrayOutputStream f = new ByteArrayOutputStream (); String s = "This should end up in the array"; byte BUF [] = s.getbytes ();

F.Write (BUF); System.out.Println ("Buffer As A String"); System.out.Println (f.tostring ()); System.out.Println ("Into Array); Byte B [] = f.TobyteaRray (); for (int i = 0; i

转载请注明原文地址:https://www.9cbs.com/read-131690.html

New Post(0)