Created
March 21, 2020 03:15
-
-
Save affandes/32a671f3ba3c8fe78485a0ff107c5b60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.ByteArrayInputStream; | |
public class ByteStream { | |
public static void main(String[] args) { | |
// Contoh input dari String | |
String teks = "ABC"; | |
// Buat input stream | |
ByteArrayInputStream input = new ByteArrayInputStream(teks.getBytes()); | |
// Salin input stream ke variabel | |
int first = input.read(); | |
// Variabel siap digunakan | |
System.out.println("first = " + first); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment