[Áú¹®:±ÞÇÕ´Ï´Ù.]È­ÀÏÀÇ ³»¿ëÀ» byte¹è¿­·Î ¿Å±æ¶§ ¿¡·¯ ¹®ÀÇ


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

±Û¾´ÀÌ :¼ÛÄ¡ºÀ 1999³â 10¿ù 12ÀÏ 11:05:11

È­ÀÏÀ» ¿ÀÇÂÇÏ°í ±× È­ÀÏÀÇ ³»¿ëÀ» FileInputStreamÀ¸·Î ¹Þ¾Æ¼­ byte ¹è¿­·Î ¿Å±â·Á°í Çϴµ¥ ÇÁ·Î±×·¥ ¿¡·¯°¡ ¹ß»ýÇÕ´Ï´Ù. ¿¡·¯ ³»¿ë°ú ¼Ò½º ÄÚµå´Â ´ÙÀ½°ú °°½À´Ï´Ù.


¿¡·¯ :


java.io.StreamCorruptException: InputStream does not contain a serialized object Stacktrace is disabled. Set JAVA_COMPCMD=STA(CKTRACE) to enable.



ÇÁ·Î±×·¥ ¼Ò½º :


byte b1[];
byte tmp;

com.sun.java.swing.JFrame frame1 = new com.sun.java.swing.JFrame();
FileDialog fdRead = new FileDialog(frame1);
fdRead.setMode(FileDialog.LOAD);
fdRead.setVisible(true);

String theFile = fdRead.getFile();
String theFileDir = fdRead.getDirectory();

if ( (theFile == null) || (theFile.equals(""))) {
//no selected file so abort
return;
}

File file=new File(theFileDir, theFile);

b1 = new byte[(int) file.length()];

FileInputStream istream = new FileInputStream(file); --------> ¿¡·¯ ¹ß»ý ¹®Àå
ObjectInputStream in = new ObjectInputStream(istream);

for (int i=0; ((tmp = in.readByte())!=0); i++) b1[i]=tmp;



Á¦ ¼öÁØÀ¸·Î´Â µµÀúÈ÷ ¹«¾ù¶§¹®¿¡ ¿¡·¯°¡ ¹ß»ýÇÏ´ÂÁö ¸ð¸£°Ú½À´Ï´Ù.
ÀÚ¹Ù Àü¹®°¡´ÔÀÇ Áöµµ¸¦ ºÎŹµå¸³´Ï´Ù.


´ÙÀ½ ±Ûµé:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
HTML ÅÂ±× Æ÷ÇÔ ¿©ºÎ: HTML ¹®¼­ÀÏ °æ¿ì üũ
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]