|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.io.OutputStream
java.io.ObjectOutputStream
public class ObjectOutputStream
Java ±âº» µ¥ÀÌÅÍÇü°ú °´Ã¼ ±×·¡ÇÁ¸¦ OutputStream¿¡ Ãâ·ÂÇÕ´Ï´Ù. ÀÌ·¯ÇÑ °´Ã¼¸¦ ÀоîµéÀÌ·Á¸é (À籸Ãà Çϱâ) ObjectInputStream¸¦ »ç¿ëÇÕ´Ï´Ù. °´Ã¼ÀÇ Áö¼ÓÀû ±â¾ïÀº ±× ½ºÆ®¸²À» À§ÇÑ ÆÄÀÏÀ» »ç¿ëÇÏ¸é °¡´ÉÇÕ´Ï´Ù. ½ºÆ®¸²ÀÌ ³×Æ®¿öÅ© ¼ÒÄÏ ½ºÆ®¸²ÀÇ °æ¿ì´Â ´Ù¸¥ È£½ºÆ®³ª ´Ù¸¥ ÇÁ·Î¼¼½º»ó¿¡¼ °´Ã¼¸¦ À籸Ãà ÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
½ºÆ®¸²¿¡ Ãâ·ÂÇÒ ¼ö ÀÖ´Â °ÍÀº java.io.Serializable ÀÎÅÍÆäÀ̽º¸¦ Áö¿øÇÏ´Â °´Ã¼¸¸ÀÔ´Ï´Ù. °¢ Á÷·ÄÈ °¡´É °´Ã¼ÀÇ Å¬·¡½º´Â Ŭ·¡½ºÀÇ À̸§°ú ½Ã±×´ÏÃÄ, °´Ã¼ÀÇ Çʵ尪¿Í ¹è¿ ¹× Ãʱ⠰´Ã¼·ÎºÎÅÍ ÂüÁ¶µÇ´Â °Í ¿ÜÀÇ ¸ðµç °´Ã¼ÀÇ Å©·ÎÀ𸦠Æ÷ÇÔÇØ encode µË´Ï´Ù.
°´Ã¼¸¦ ½ºÆ®¸²¿¡ Ãâ·ÂÇÏ·Á¸é writeObject ¸Þ¼µå¸¦ »ç¿ëÇÕ´Ï´Ù. String ³ª ¹è¿À» Æ÷ÇÔÇÑ ÀÓÀÇÀÇ °´Ã¼°¡ writeObject¿¡ ÀÇÇØ Ãâ·ÂÇØÁý´Ï´Ù. º¹¼öÀÇ °´Ã¼³ª ¿ø½ÃÀûµµ, ½ºÆ®¸²¿¡ÀÇ Ãâ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù. °´Ã¼¸¦ ÀоîµéÀÏ ¶§´Â ´ëÀÀÇÏ´Â ObjectInputstream ·ÎºÎÅÍ °°Àº ÇüÅ·μ ÇÑÆí Ãâ·ÂÇØÁ³À» ¶§¿Í °°Àº ¼ø¼·Î ÀоîµéÀÌÁö ¾ÊÀ¸¸é ¾ÈµË´Ï´Ù.
±âº» µ¥ÀÌÅÍÇüÀ» ½ºÆ®¸²¿¡ Ãâ·ÂÇÏ·Á¸é, DataOutput ÀûÀýÇÑ ¸Þ¼µå¸¦ »ç¿ëÇÕ´Ï´Ù. String¸¦ Ãâ·ÂÇÏ´Â °æ¿ì´Â writeUTF ¸Þ¼µå¸¦ »ç¿ëÇÕ´Ï´Ù.
°´Ã¼ÀÇ µðÆúÆ®ÀÇ Á÷·ÄÈ µµ±¸´Â Ŭ·¡½ºÀÇ °´Ã¼, Ŭ·¡½ºÀÇ ½Ã±×´ÏÃÄ ¹× ¸ðµç ºñ transient¿Í ºñ static Çʵ尡 °¡Áö´Â °ªÀ» Ãâ·ÂÇÕ´Ï´Ù. ´Ù¸¥ °´Ã¼¿¡ÀÇ ÂüÁ¶ (transient¿Í static Çʵå´Â Á¦¿ÜÇÏ´Ù)°¡ ÀÖÀ¸¸é, ÀÌ·¯ÇÑ °´Ã¼µµ ¿ª½Ã Ãâ·ÂÇØÁý´Ï´Ù. ´ÜÀÏ °´Ã¼¿¡ÀÇ ´ÙÁß ÂüÁ¶´Â ÂüÁ¶ °øÀ¯ µµ±¸¿¡ ÀÇÇØ encode µÇ¾î °´Ã¼ ±×·¡ÇÁ¸¦, ¿À¸®Áö³¯ÀÌ Ãâ·ÂÇØÁ³À» ¶§ÀÇ Çü»ó¿¡ º¹¿øÇÒ ¼ö ÀÖ½À´Ï´Ù .
¿¹¸¦ µé¾î
ObjectInputStream
¿¹·Î ÀоîµéÀÏ ¼ö ÀÖµµ·Ï °´Ã¼¸¦ Ãâ·ÂÇÏ·Á¸é,
´ÙÀ½°ú °°ÀÌ ÇÕ´Ï´Ù.
FileOutputStream fos = new FileOutputStream("t.tmp"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeInt(12345); oos.writeObject("Today"); oos.writeObject(new Date()); oos.close();
Á÷·ÄÈ¿Í Á÷·ÄÈ º¹¿ø ½Ã¿¡ Ư¼öÇÑ Ãë±ÞÀÌ ÇÊ¿äÇÑ Å¬·¡½º¿¡¼´Â Á¤È®ÇÏ°Ô ´ÙÀ½°ú °°Àº ½Ã±×´ÏÃĸ¦ °¡Áö´Â Ư¼öÇÑ ¸Þ¼µå¸¦ ±¸ÇöÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException; private void writeObject(java.io.ObjectOutputStream stream) throws IOException
writeObject ¸Þ¼µå´Â ´ëÀÀÇÏ´Â readObject°¡ °´Ã¼ »óŸ¦ º¹¿øÇÒ ¼ö°¡ ÀÖµµ·Ï, °´Ã¼ÀÇ Æ¯Á¤ÀÇ Å¬·¡½º¿¡ µµÂøÇØ, °´Ã¼ »óŸ¦ Ãâ·ÂÇÒ Ã¥ÀÓÀÌ ÀÖ½À´Ï´Ù. ÀÌ ¸Þ¼µå´Â °´Ã¼ÀÇ ½´ÆÛ Ŭ·¡½º³ª ¼ºê Ŭ·¡½º¿¡ ¼ÓÇÏ´Â »óÅ¿¡ °ü¿©ÇÒ ÇÊ¿ä´Â ¾ø½À´Ï´Ù. »óŸ¦ º¸Á¸ÇÏ·Á¸é, °³°³ÀÇ Çʵ忡 µµÂøÇØ writeObject ¸Þ¼µå¸¦ »ç¿ëÇØ ObjectOutputStream¿¡ Ãâ·ÂÇÏ´ÂÁö, ¶Ç´Â DataOutput°¡ Áö¿øÇÏ´Â ±âº» µ¥ÀÌÅÍÇü¿ëÀÇ ¸Þ¼µå¸¦ »ç¿ëÇÕ´Ï´Ù.
Á÷·ÄÈ´Â java.io.Serializable ÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇÏÁö ¾Ê´Â °´Ã¼ÀÇ ÇʵåÀÇ Ãâ·ÂÀº ½Ç½ÃÇÏÁö ¾Ê½À´Ï´Ù. Á÷·ÄÈ °¡´ÉÇÏÁö ¾ÊÀº °´Ã¼ÀÇ ¼ºê Ŭ·¡½º¸¦ Á÷·ÄÈ °¡´ÉÇÏ°Ô ÇÏ´Â °ÍÀº °¡´ÉÇÕ´Ï´Ù. ÀÌ °æ¿ì Á÷·ÄÈ °¡´ÉÇÏÁö ¾ÊÀº Ŭ·¡½º´Â ±× Çʵ带 ÃʱâÈÇÒ ¼ö ÀÖµµ·Ï Çϱâ À§ÇÑ, Àμö ¾øÀ½ÀÇ »ý¼ºÀÚ¸¦ °¡Áú Çʿ䰡 ÀÖ½À´Ï´Ù. ÀÌ °æ¿ì Á÷·ÄÈ °¡´ÉÇÏÁö ¾ÊÀº Ŭ·¡½º »óŸ¦ º¸Á¸ ¹× À籸Ãà ÇÏ´Â °ÍÀº ¼ºê Ŭ·¡½ºÀÇ Ã¥ÀÓÀÌ µË´Ï´Ù. ±× Ŭ·¡½ºÀÇ Çʵ尡 ¾×¼¼½º °¡´ÉÇÏ´Ù (public, package, ¶Ç´Â protected)Àΰ¡ ¶Ç´Â »óŸ¦ À籸Ãà Çϱâ À§Çؼ »ç¿ëÇÒ ¼ö ÀÖ´Â get¿Í set ¸Þ¼µå°¡ Á¸ÀçÇÏ´Â °æ¿ì°¡ ÀÚÁÖ ÀÖ½À´Ï´Ù.
writeObject¿Í readObject ¸Þ¼µå·Î NotSerializableExceptionÀ» Throw Çϵµ·Ï ±¸ÇöÇØ µÎ¸é, °´Ã¼ÀÇ Á÷·Äȸ¦ ¹æÁöÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¿Ü´Â ObjectOutputStream¿¡ ijġ µÇ¾î Á÷·ÄÈ Ã³¸®¸¦ ÀÌ»óÁ¾·á(ABEND) ½Ãŵ´Ï´Ù.
Externalizable ÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇϸé, °´Ã¼ÀÇ Á÷·ÄÈ µÈ Çü½ÄÀÇ ³»¿ë ¹× Çü½ÄÀ» °´Ã¼ÃøÀÌ ¿ÏÀüÇÏ°Ô Á¦¾îÇÏ´Â °ÍÀÌ °¡´ÉÇÏ°Ô µË´Ï´Ù. Externalizable ÀÎÅÍÆäÀ̽ºÀÇ ¸Þ¼µåÀÎ writeExternal¿Í readExternal´Â °´Ã¼ »óŸ¦ º¸Á¸ ¹× º¹¿øÇϱâ À§Çؼ È£ÃâÇÕ´Ï´Ù. ÀÌ·¯ÇÑ ¸Þ¼µå´Â Ŭ·¡½º¿¡ ÀÇÇØ ±¸ÇöµÇ¾úÀ» °æ¿ì¿¡´Â ObjectOutput¿Í ObjectInput ¸ðµç ¸Þ¼µå¸¦ »ç¿ëÇØ, ÀڽŠ»óÅÂÀÇ Ãâ·Â ¹× read¸¦ ½Ç½ÃÇÒ ¼ö ÀÖ½À´Ï´Ù . ¾î¶°ÇÑ ¹öÀüÀ̾ ó¸®ÇÒ ¼ö ÀÖµµ·Ï ÇÏ´Â °ÍÀº °´Ã¼ÀÇ Ã¥ÀÓÀÔ´Ï´Ù.
enum Á¤¼ö´Â º¸Åë ÀÇ Á÷·ÄÈ °¡´É °´Ã¼³ª ¿ÜºÎÈ °¡´É °´Ã¼¿Í´Â ´Ù¸¥ ¹æ¹ýÀ¸·Î Á÷·ÄÈ µË´Ï´Ù. enum Á¤¼öÀÇ Á÷·ÄÈ Çü½ÄÀº À̸§¸¸À¸·Î ±¸¼ºµË´Ï´Ù. Á¤¼öÀÇ Çʵ尪´Â Àü¼Û µÇÁö ¾Ê½À´Ï´Ù. enum Á¤¼ö¸¦ Á÷·ÄÈÇϱâ À§Çؼ ObjectOutputStream´Â Á¤¼öÀÇ À̸§ ¸Þ¼µå·ÎºÎÅÍ ¸®ÅÏµÈ Ä³¸¯ÅÍ ¶óÀÎÀ» Ãâ·ÂÇÕ´Ï´Ù. ´Ù¸¥ Á÷·ÄÈ °¡´É °´Ã¼ ¶Ç´Â ¿ÜºÎÈ °¡´É °´Ã¼¿Í °°ÀÌ, enum Á¤¼öµµ, Á÷·ÄÈ ½ºÆ®¸²¿¡ ³ªÁß¿¡ ³ªÅ¸³ª´Â ¿ªÂüÁ¶ÀÇ Å¸°ÙÀ¸·Î¼ ±â´ÉÇÒ ¼ö ÀÖ½À´Ï´Ù. enum Á¤¼ö°¡ Á÷·ÄÈ µÇ´Â ¼ø¼´Â Ä¿½ºÅ͸¶ÀÌÁî ÇÒ ¼ö ¾ø½À´Ï´Ù. Áï, enum Çü¿¡ ÀÇÇØ Á¤ÀǵÈ, Ŭ·¡½º ƯÀ¯ÀÇ writeObject ¹× writeReplace ¸Þ¼µå´Â Á÷·ÄÈÀÇ »çÀÌ´Â ¹«½ÃµË´Ï´Ù. °°ÀÌ serialPersistentFields ¶Ç´Â serialVersionUID ÇÊµå ¼±¾ðµµ ¹«½ÃµË´Ï´Ù. ¸ðµç enum ÇüÀº serialVersionUID°¡ 0L¿¡ °íÁ¤µÇ°í ÀÖ½À´Ï´Ù.
Á÷·ÄÈ °¡´É ÇÊµå ¹× ¿ÜºÎÈ °¡´É µ¥ÀÌÅ͸¦ Á¦¿ÜÇÑ ¿ø½ÃÀû µ¥ÀÌÅÍ´Â ºí·Ï µ¥ÀÌÅÍ ·¹ÄÚµå·Î¼ ObjectOutputStream¿¡ Ãâ·ÂÇØÁý´Ï´Ù. ºí·Ï µ¥ÀÌÅÍ ·¹ÄÚµå´Â Çì´õ¿Í µ¥ÀÌÅÍ·Î ±¸¼ºµË´Ï´Ù. ºí·Ï µ¥ÀÌÅÍÀÇ Çì´õ´Â ¸¶Ä¿ ¹× Çì´õ¿¡ °è¼ÓµÇ´Â ¹ÙÀÌÆ®¼ö·Î ±¸¼ºµË´Ï´Ù. ¿¬¼ÓÇÏ´Â ¿ø½ÃÀû µ¥ÀÌÅÍÀÇ Ãâ·ÂÀº 1°³ÀÇ ºí·Ï µ¥ÀÌÅÍ ·¹Äڵ忡 ¸ÓÁö µË´Ï´Ù. ºí·Ï µ¥ÀÌÅÍ ·¹Äڵ忡 »ç¿ëµÇ´Â ºí·Ï °è¼ö´Â 1024 ¹ÙÀÌÆ®ÀÔ´Ï´Ù. °¢ ºí·Ï µ¥ÀÌÅÍ ·¹ÄÚµå´Â 1024 ¹ÙÀÌÆ®±îÁö ÆÄ¹¯È÷´ÂÁö, ºí·Ï µ¥ÀÌÅÍ ¸ðµåÀÇ Á¾·á±îÁö Ãâ·ÂÇØÁý´Ï´Ù. ObjectOutputStream ¸Þ¼µå writeObject, defaultWriteObject ¹× writeFields¸¦ È£ÃâÇϸé, ÃÖÃÊ·Î ±âÁ¸ÀÇ ºí·Ï µ¥ÀÌÅÍ ·¹Äڵ尡 Á¾·áµË´Ï´Ù.
DataOutput
,
ObjectInputStream
,
Serializable
,
Externalizable
,
Object Serialization Specification, Section 2, Object Output Classes Áßø(Nested) Ŭ·¡½º °³¿ä | |
---|---|
static class |
ObjectOutputStream.PutField
ObjectOutput¿¡ Ãâ·ÂÇØÁö´Â Áö¼Ó Çʵ忡ÀÇ ÇÁ·Î±×·¥¿¡ ÇÑ ¾×¼¼½º¸¦ Á¦°øÇÕ´Ï´Ù. |
ÇÊµå °³¿ä |
---|
»ý¼ºÀÚ °³¿ä | |
---|---|
protected |
ObjectOutputStream ()
ObjectOutputStream¸¦ ¿ÏÀüÇÏ°Ô ´Ù½Ã ±¸ÇöÇÏ´Â ¼ºê Ŭ·¡½º°¡ ObjectOutputStream ÀÌ ±¸Çö¿¡ ÀÇÇØ »ç¿ëµÈÁö ¾ó¸¶ ¾ÈµÈ private µ¥ÀÌÅ͸¦ ÇÒ´çÇÒ Çʿ䰡 ¾ø°Ô ÇÏ´Â ¼ö´ÜÀ» Á¦°øÇÕ´Ï´Ù. |
|
ObjectOutputStream (OutputStream out)
ÁöÁ¤µÈ OutputStream¿¡ Ãâ·ÂÇÏ´Â ObjectOutputStream¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
protected void |
annotateClass (Class <? > cl)
¼ºê Ŭ·¡½º´Â Ŭ·¡½ºÀÇ µ¥ÀÌÅ͸¦ ½ºÆ®¸²¿¡ º¸Á¸ÇÒ ¼ö ÀÖµµ·Ï ÀÌ ¸Þ¼µå¸¦ ±¸ÇöÇÏ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. |
protected void |
annotateProxyClass (Class <? > cl)
¼ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼µå¸¦ ±¸ÇöÇØ, ´ÙÀ̳ª¹Í ÇÁ·Ï½Ã Ŭ·¡½º¿¡ ´ëÇÑ ±â¼úÀÚ¿Í ÇÔ²² Ä¿½ºÅÒ µ¥ÀÌÅ͸¦ ½ºÆ®¸²¿¡ Æ÷ÇÔÇÕ´Ï´Ù. |
void |
close ()
½ºÆ®¸²À» ´Ý½À´Ï´Ù. |
void |
defaultWriteObject ()
ÇöÀçÀÇ Å¬·¡½ºÀÇ ºñ static Çʵå¿Í ºñ transient Çʵ带, ½ºÆ®¸²¿¡ Ãâ·ÂÇÕ´Ï´Ù. |
protected void |
drain ()
ObjectOutputStream¿¡ ÀÖ´Â ¹öÆÛ µ¥ÀÌÅ͸¦ ¸ðµÎ ºñ¿ó´Ï´Ù. |
protected boolean |
enableReplaceObject (boolean enable)
½ºÆ®¸²³»¿¡¼ °´Ã¼¸¦ ġȯÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù. |
void |
flush ()
½ºÆ®¸²À» Ç÷¡½Ã ÇÕ´Ï´Ù. |
ObjectOutputStream.PutField |
putFields ()
½ºÆ®¸²¿¡ Ãâ·ÂÇØÁö´Â Áö¼Ó Çʵ带 ¹öÆÛ¿¡ Æ÷ÇÔÇϱâ À§Çؼ »ç¿ëµÇ´Â °´Ã¼¸¦ ÃëµæÇÕ´Ï´Ù. |
protected Object |
replaceObject (Object obj)
Á÷·ÄÈ ½Ã¿¡ ObjectOutputStream ½Å·ÚÇÒ ¼ö ÀÖ´Â ¼ºê Ŭ·¡½º°¡ ¾î´À °´Ã¼¸¦ ´Ù¸¥ °´Ã¼¿¡ ġȯÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù. |
void |
reset ()
½ºÆ®¸²¿¡ ÀÌ¹Ì Ãâ·ÂÇØÁö°í ÀÖ´Â °´Ã¼ »óŸ¦ ¹«È¿·Î ÇÕ´Ï´Ù. |
void |
useProtocolVersion (int version)
½ºÆ®¸²ÀÇ Ãâ·Â½Ã¿¡ »ç¿ëÇÏ´Â ½ºÆ®¸² ÇÁ·ÎÅäÄÝÀÇ ¹öÀüÀ» ÁöÁ¤ÇÕ´Ï´Ù. |
void |
write (byte[] buf)
¹ÙÀÌÆ® ¹è¿À» Ãâ·ÂÇÕ´Ï´Ù. |
void |
write (byte[] buf,
int off,
int len)
¹ÙÀÌÆ® ¹è¿ÀÇ ÀϺθ¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
write (int val)
µ¥ÀÌÅÍÀÇ ¹ÙÀÌÆ®¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeBoolean (boolean val)
boolean¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeByte (int val)
8 ºñÆ®ÀÇ ¹ÙÀÌÆ®¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeBytes (String str)
String¸¦ ¹ÙÀÌÆ®ÀÇ ¿·Î¼ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeChar (int val)
16 ºñÆ®ÀÇ char¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeChars (String str)
String¸¦ char ¿·Î¼ Ãâ·ÂÇÕ´Ï´Ù. |
protected void |
writeClassDescriptor (ObjectStreamClass desc)
ObjectOutputStream ·Î ÁöÁ¤µÈ Ŭ·¡½º ±â¼úÀÚ¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeDouble (double val)
64 ºñÆ®ÀÇ double¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeFields ()
¹öÆÛ¿¡ Æ÷ÇÔµÈ Çʵ带 ½ºÆ®¸²¿¡ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeFloat (float val)
32 ºñÆ®ÀÇ float¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeInt (int val)
32 ºñÆ®ÀÇ int¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeLong (long val)
64 ºñÆ®ÀÇ long¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeObject (Object obj)
ÁöÁ¤µÈ °´Ã¼¸¦ ObjectOutputStream¿¡ Ãâ·ÂÇÕ´Ï´Ù. |
protected void |
writeObjectOverride (Object obj)
¼ºê Ŭ·¡½º¿¡ ÀÇÇØ µðÆúÆ®ÀÇ writeObject ¸Þ¼µåÀÇ ¿À¹ö¶óÀ̵å(override)¿¡ »ç¿ëµË´Ï´Ù. |
void |
writeShort (int val)
16 ºñÆ®ÀÇ short¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
protected void |
writeStreamHeader ()
¼ºê Ŭ·¡½º°¡ ÀÚ½ÅÀÇ Çì´õ¸¦ ½ºÆ®¸²ÀÇ Àü ¶Ç´Â µÚ·Î Ãß°¡ÇÒ ¼ö ÀÖµµ·Ï Á¦°øµÇ°í ÀÖ½À´Ï´Ù. |
void |
writeUnshared (Object obj)
ObjectOutputStream¿¡ ¡¸°øÀ¯µÇÁö ¾Ê´Â´Ù¡¹°´Ã¼¸¦ Ãâ·ÂÇÕ´Ï´Ù. |
void |
writeUTF (String str)
ÀÌ String ¿ø½ÃÀû µ¥ÀÌÅ͸¦¼öÁ¤ UTF-8 Çü½Ä¿¡¼ Ãâ·ÂÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
»ý¼ºÀÚ »ó¼¼ |
---|
public ObjectOutputStream(OutputStream out) throws IOException
½ÃÅ¥·¯Æ¼ ¸Å´ÏÀú°¡ ÀνºÅç µÇ°í ÀÖ´Â °æ¿ì, ObjectOutputStream.putFields ¸Þ¼µå ¶Ç´Â ObjectOutputStream.writeUnshared ¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÏ´Â ¼ºê Ŭ·¡½ºÀÇ »ý¼ºÀÚ¿¡ ÀÇÇØ SerializablePermission("enableSubclassImplementation")°¡ Á÷Á¢ ¶Ç´Â °£Á¢¿¡ ºÒ·Á °¬À» ¶§¿¡ ÀÌ »ý¼ºÀÚ´Â ÀÌ Á¢±Ù ±ÇÇÑÀ» È®ÀÎÇÕ´Ï´Ù.
out
- Ãâ·ÂóÀÇ Ãâ·Â ½ºÆ®¸²
IOException
- ½ºÆ®¸² Çì´õÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
SecurityException
- ½Å·ÚµÇ¾î ÀÖÁö ¾ÊÀº ¼ºê Ŭ·¡½º°¡ º¸¾È»ó Áß¿äÇÑ ¸Þ¼µå¸¦ ºÎÁ¤ÇÏ°Ô ¿À¹ö¶óÀ̵å(override) ÇßÀ» °æ¿ì
NullPointerException
- out
ÀÌ null
ÀÎ °æ¿ìObjectOutputStream()
,
putFields()
,
ObjectInputStream.ObjectInputStream(InputStream)
protected ObjectOutputStream() throws IOException, SecurityException
½ÃÅ¥·¯Æ¼ ¸Å´ÏÀú°¡ ÀνºÅç µÇ°í ÀÖ´Â °æ¿ì, ÀÌ ¸Þ¼µå´Â ¿ì¼± ½ÃÅ¥·¯Æ¼ ¸Å´ÏÀúÀÇ checkPermission
¸Þ¼µå¸¦ Á¢±Ù ±ÇÇÑ SerializablePermission("enableSubclassImplementation")
·Î
È£ÃâÇØ, »ó¼Ó
À¯È¿ÇÏ°Ô ÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù.
SecurityException
- ½ÃÅ¥·¯Æ¼ ¸Å´ÏÀú°¡ Á¸ÀçÇØ, ±× checkPermission
¸Þ¼µå°¡ »ó¼Ó
À¯È¿ÇÏ°Ô ÇÏ´Â °ÍÀ» °ÅºÎÇßÀ» °æ¿ì
IOException
SecurityManager.checkPermission(java.security.Permission)
,
SerializablePermission
¸Þ¼µåÀÇ »ó¼¼ |
---|
public void useProtocolVersion(int version) throws IOException
ÀÌ ·çƾÀº ÇöÀçÀÇ ¹öÀüÀÇ Á÷·ÄȰ¡ ÀüÀÇ ¹öÀüÀÇ ½ºÆ®¸² Çü½Ä°ú ÇÏÀ§ ȣȯ¼ºÀÌ ÀÖ´Â Çü½Ä¿¡¼ Ãâ·ÂÇÒ ¼ö ÀÖµµ·Ï ÇÏ´Â ÈÅÀ» Á¦°øÇÕ´Ï´Ù.
ÇÏÀ§ ȣȯ¼ºÀÌ ¾ø´Â Çü½ÄÀÌ ¶ÇÇÑ µµÀԵǴ °ÍÀ» ¸·±â À§Çؼ ¸ðµç ³ë·ÂÀ» ÇÕ´Ï´Ù¸¸, ¼±ÅÃÀÇ ¿©Áö°¡ ¾ø´Â °æ¿ìµµ ÀÖ½À´Ï´Ù.
version
- java.io.ObjectStreamConstants ·ÎºÎÅÍ ProtocolVersion¸¦ »ç¿ë
IllegalStateException
- °´Ã¼°¡ Á÷·ÄÈ µÈ µÚ¿¡ ºÒ·Á °¬À» °æ¿ì
IllegalArgumentException
- °Ç³×¹ÞÀº ¹öÀüÀÌ ¹«È¿ÀÎ °æ¿ì
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìObjectStreamConstants.PROTOCOL_VERSION_1
,
ObjectStreamConstants.PROTOCOL_VERSION_2
public final void writeObject(Object obj) throws IOException
¿¹¿Ü´Â OutputStream¿¡ °üÇÑ ¹®Á¦³ª, Á÷·ÄÈÇØ¾ß ÇÏ´Â °ÍÀÌ ¾Æ´Ñ Ŭ·¡½º¿¡ µµÂøÇØ ¹ß»ý µË´Ï´Ù. ¸ðµç ¿¹¿Ü´Â OutputStream¿¡ ÀÖ¾î Ä¡¸íÀûÀ̾î, OutputStream¸¦ ºÒÈ®Á¤ÀÎ »óÅ·ΠÇÕ´Ï´Ù. ½ºÆ®¸² »óŸ¦ ¹«½ÃÇÒ±î ȸº¹ ó¸®Çұ °áÁ¤ÇÏ´Â °ÍÀº È£ÃâÃøÀÔ´Ï´Ù.
ObjectOutput
³»ÀÇ writeObject
obj
- Ãâ·ÂÇØÁö´Â °´Ã¼
InvalidClassException
- Á÷·ÄÈ·Î »ç¿ëµÇ´Â Ŭ·¡½º¿¡ ÇϵîÀÇ ºÒÆíÀÌ ÀÖ¾úÀ» °æ¿ì
NotSerializableException
- Á÷·ÄÈÀÇ ´ë»ó °´Ã¼°¡ java.io.Serializable ÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇϰí ÀÖÁö ¾Ê´Â °æ¿ì
IOException
- ±âº»ÀÌ µÇ´Â OutputStream°¡ ¿¹¿Ü¸¦ Throw ÇßÀ» °æ¿ìprotected void writeObjectOverride(Object obj) throws IOException
obj
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²¿¡ Ãâ·ÂÇØÁö´Â °´Ã¼
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìObjectOutputStream()
,
writeObject(Object)
public void writeUnshared(Object obj) throws IOException
ÀÌ ¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÏ´Â ObjectOutputStream ¼ºê Ŭ·¡½º´Â SerializablePermission("enableSubclassImplementation")¸¦ °¡Áö´Â ½ÃÅ¥·¯Æ¼ ÄÁÅØ½ºÆ® ³»¿¡¼¸¸ ±¸ÃàÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ Á¢±Ù ±ÇÇÑÀ» °¡ÁöÁö ¾Ê´Â ½ÃÅ¥·¯Æ¼ ÄÁÅØ½ºÆ® À¸·Î ÀνºÅϽºÈÇÏ·Á°í Çϸé, SecurityException°¡ ¹ß»ý µË´Ï´Ù.
obj
- ½ºÆ®¸²¿¡ Ãâ·ÂÇÏ´Â °´Ã¼
NotSerializableException
- Á÷·ÄÈÇÏ´Â ±×·¡ÇÁ³»ÀÇ °´Ã¼°¡ Serializable ÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇÏÁö ¾Ê´Â °æ¿ì
InvalidClassException
- Á÷·ÄÈÇÏ´Â °´Ã¼ÀÇ Å¬·¡½º¿¡ ¹®Á¦°¡ ÀÖ´Â °æ¿ì
IOException
- Á÷·ÄÈÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void defaultWriteObject() throws IOException
IOException
- ±âº»ÀÌ µÇ´Â OutputStream
Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic ObjectOutputStream.PutField putFields() throws IOException
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeFields() throws IOException
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
NotActiveException
- °´Ã¼ »óŸ¦ Ãâ·ÂÇϱâ À§Çؼ Ŭ·¡½ºÀÇ writeObject ¸Þ¼µå°¡ ºÒ·Á°¡
Áö ¾Ê¾ÒÀ» ¶§¿¡ ºÒ·Á °¬À» °æ¿ìpublic void reset() throws IOException
IOException
- °´Ã¼¸¦ Á÷·ÄÈÁß¿¡ reset()°¡ ºÒ·Á °¬À» °æ¿ìprotected void annotateClass(Class <? > cl) throws IOException
cl
- Ä¿½ºÅÒ µ¥ÀÌÅÍ¿¡ ÁÖ¼®À» ºÙÀ̴ Ŭ·¡½º
IOException
- ±âº»ÀÌ µÇ´Â OutputStream°¡ ¿¹¿Ü¸¦ Throw ÇßÀ» °æ¿ìprotected void annotateProxyClass(Class <? > cl) throws IOException
ÀÌ ¸Þ¼µå´Â ½ºÆ®¸²ÀÇ ÀÏÀÇÀÇ ÇÁ·Ï½Ã Ŭ·¡½º ±â¼úÀÚÀÇ °¢°¢ ºÙ¾î 1ȸ
¸¸ È£ÃâÇÕ´Ï´Ù. ObjectOutputStream
¿¡ ÀÖ´Â ÀÌ ¸Þ¼µåÀÇ µðÆúÆ® ±¸ÇöÀº ¾Æ¹«°Íµµ ÇÏÁö ¾Ê½À´Ï´Ù.
ObjectInputStream
¿¡
¼ÀÇ ´ëÀÀÇÏ´Â ¸Þ¼µå´Â resolveProxyClass
ÀÔ´Ï´Ù. ÀÌ ¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÏ´Â ÁöÁ¤µÈ ¼ºê Ŭ·¡½º ObjectOutputStream
¿¡ ´ëÇØ¼
ObjectInputStream
´ëÀÀÇÏ´Â ¼ºê Ŭ·¡½º¿¡ ÀÖ´Â resolveProxyClass
¸Þ¼µå´Â annotateProxyClass
°¡ Ãâ·ÂÇÏ´Â ÀÓÀÇÀÇ µ¥ÀÌÅÍ ¶Ç´Â °´Ã¼¸¦ ÀоîµéÀÏ Çʿ䰡 ÀÖ½À´Ï´Ù.
cl
- Ä¿½ºÅÒ µ¥ÀÌÅÍ¿¡ ÁÖ¼®À» ºÙÀÌ´Â ÇÁ·Ï½Ã Ŭ·¡½º
IOException
- ±âº»ÀÌ µÇ´Â OutputStream
°¡ ¿¹¿Ü¸¦ Throw ÇßÀ» °æ¿ìObjectInputStream.resolveProxyClass(String[])
protected Object replaceObject(Object obj) throws IOException
ObjectOutputStream.writeObject ¸Þ¼µå´Â Object ÇüÀÇ ÆÄ¶ó¹ÌÅÍ (Serializable Çü°ú´Â ´Ù¸£´Ù)¸¦ ÃëÇØ, Á÷·ÄÈ °¡´ÉÇÏÁö ¾ÊÀº °´Ã¼°¡ Á÷·ÄÈ °¡´É °´Ã¼·Î ¿Å°ÜÁöµµ·Ï ÇÕ´Ï´Ù.
¼ºê Ŭ·¡½º´Â °´Ã¼¸¦ ġȯÇÒ ¶§, Á÷·ÄÈ º¹¿ø ½ÇÇà½Ã¿¡ »óº¸ÀûÀ¸·Î ġȯÀ» ÇÏ´ÂÁö, ¶Ç´Â ġȯµÈ °´Ã¼¿Í ÂüÁ¶°¡ Æ÷ÇԵǴ °¢ Çʵå¿ÍÀÇ È£È¯¼ºÀ» º¸ÁõÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. ÇÊµå ¶Ç´Â ¹è¿ ¿ä¼ÒÀÇ ÇüÅÂÀÇ ¼ºê Ŭ·¡½º°¡ ¾Æ´Ñ ÇüÅÂÀÇ °´Ã¼´Â ¿¹¿Ü¸¦ ¹ß»ý½ÃŰ´Â °Í¿¡ ÀÇÇØ Á÷·Äȸ¦ Áß´ÜÇØ, ±× °á°ú °´Ã¼´Â Æ÷ÇÔµÇÁö ¾Ê½À´Ï´Ù.
ÀÌ ¸Þ¼µå´Â °¢ °´Ã¼°¡ ÃÖÃÊ·Î °ËÃâµÇ¾úÀ» ¶§¿¡ 1ȸ ¸¸ È£ÃâÇÕ´Ï´Ù. ÀÌ°Í ÀÌÈÄ °ËÃâµÇ´Â ±× °´Ã¼¿¡ÀÇ ÂüÁ¶´Â »õ·Î¿î °´Ã¼¿¡ ¸®´ÙÀÌ·ºÆ® µË´Ï´Ù. ÀÌ ¸Þ¼µå´Â ġȯµÇ´Â ¸Þ¼µåÀΰ¡ ¶Ç´Â ¿À¸®Áö³¯ÀÇ ¾î´À ÂÊÀÎÁö¸¦ µ¹·ÁÁÖÁö ¾ÊÀ¸¸é ¾ÈµË´Ï´Ù.
ġȯµÇ´Â °´Ã¼·Î¼ nullÀ» µ¹·ÁÁÙ ¼öµµ ÀÖ½À´Ï´Ù¸¸, ¿À¸®Áö³¯ °´Ã¼¿¡ÀÇ ÂüÁ¶¸¦ Æ÷ÇÔÇÑ Å¬·¡½º¿¡¼´Â nullÀº ¾Æ´Ï°í °´Ã¼°¡ ¸®ÅÏµÈ °ÍÀ» °¡Á¤Çϰí ÀÖ´Â °ÍÀÌ ÀÖ¾î, ÀÌ °æ¿ì´Â NullReferenceException°¡ ¹ß»ý µË´Ï´Ù.
obj
- ¿Å°Ü³õÀ» ¼ö ÀÖ´Â °´Ã¼
IOException
- ±âº»ÀÌ µÇ´Â OutputStream°¡ ¿¹¿Ü¸¦ Throw ÇßÀ» °æ¿ìprotected boolean enableReplaceObject(boolean enable) throws SecurityException
enable
°¡ true ·Î ½ÃÅ¥·¯Æ¼ ¸Å´ÏÀú°¡ ÀνºÅç µÇ°í ÀÖ´Â °æ¿ì, ÀÌ ¸Þ¼µå´Â ¿ì¼± ½ÃÅ¥·¯Æ¼ ¸Å´ÏÀúÀÇ checkPermission
¸Þ¼µå¸¦ Á¢±Ù ±ÇÇÑ SerializablePermission("enableSubstitution")
·Î
È£ÃâÇØ, ½ºÆ®¸²ÀÇ °´Ã¼¸¦ ½ºÆ®¸²À» ġȯÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù.
enable
- °´Ã¼ÀÇ Ä¡È¯À» °¡´ÉÇÏ°Ô ÇÏ´Â boolean ÆÄ¶ó¹ÌÅÍ
SecurityException
- ½ÃÅ¥·¯Æ¼ ¸Å´ÏÀú°¡ Á¸ÀçÇØ, ±× checkPermission
¸Þ¼µå°¡ ½ºÆ®¸²³»ÀÇ °´Ã¼ÀÇ ½ºÆ®¸²¿¡
ÇÑ Ä¡È¯À» Çã°¡ÇÏÁö ¾Ê¾Ò´ø °æ¿ìSecurityManager.checkPermission(java.security.Permission)
,
SerializablePermission
protected void writeStreamHeader() throws IOException
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìprotected void writeClassDescriptor(ObjectStreamClass desc) throws IOException
readClassDescriptor
Àº ¿À¹ö¶óÀ̵å(override) µÇ°í Ŭ·¡½º ±â¼úÀÚ¸¦ Ä¿½ºÅÒ ½ºÆ®¸² Ç¥ÇöÀ¸·ÎºÎÅÍ º¹¿øÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. µðÆúÆ®¿¡¼´Â ÀÌ ¸Þ¼µå´Â °´Ã¼ Á÷·ÄÈ »ç¾çÀ¸·Î Á¤ÀÇµÈ Çü½Ä¿¡ µû¶ó Ŭ·¡½º ±â¼úÀÚ¸¦ Ãâ·ÂÇÕ´Ï´Ù.
ÀÌ ¸Þ¼µå´Â ObjectOutputStream°¡ ³°Àº Á÷·ÄÈ ½ºÆ®¸² Çü½Ä (ObjectOutputStream
useProtocolVersion
¸Þ¼µå¸¦ È£ÃâÇØ ¼³Á¤)À» »ç¿ëÇϰí ÀÖÁö ¾Ê´Â °æ¿ì¿¡ ÇÑÁ¤ÇØ È£ÃâµÇ´Â Á¡¿¡ ÁÖÀÇÇØ ÁÖ¼¼¿ä. ÀÌ Á÷·ÄÈ ½ºÆ®¸²ÀÌ ³°Àº Çü½Ä (PROTOCOL_VERSION_1
)À» »ç¿ëÇϰí ÀÖ´Â °æ¿ì, Ŭ·¡½º ±â¼úÀÚ´Â ¿À¹ö¶óÀ̵å(override) µÇÁö ¾Ê´Â ¹æ¹ý ¶Ç´Â Ä¿½ºÅ͸¶ÀÌÁî ÇÒ ¼ö ¾ø´Â ¹æ¹ýÀ¸·Î ³»ºÎÀûÀ¸·Î Ãâ·ÂÇØÁý´Ï´Ù.
desc
- ½ºÆ®¸²¿¡ Ãâ·ÂÇϴ Ŭ·¡½º ±â¼úÀÚ
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìObjectInputStream.readClassDescriptor()
,
useProtocolVersion(int)
,
ObjectStreamConstants.PROTOCOL_VERSION_1
public void write(int val) throws IOException
DataOutput
³»ÀÇ write
ObjectOutput
³»ÀÇ write
OutputStream
³»ÀÇ write
val
- ½ºÆ®¸²¿¡ Ãâ·ÂÇØÁö´Â ¹ÙÀÌÆ®
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void write(byte[] buf) throws IOException
DataOutput
³»ÀÇ write
ObjectOutput
³»ÀÇ write
OutputStream
³»ÀÇ write
buf
- Ãâ·ÂÇØÁö´Â µ¥ÀÌÅÍ
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìOutputStream.write(byte[], int, int)
public void write(byte[] buf, int off, int len) throws IOException
DataOutput
³»ÀÇ write
ObjectOutput
³»ÀÇ write
OutputStream
³»ÀÇ write
buf
- Ãâ·ÂÇØÁö´Â µ¥ÀÌÅÍoff
- µ¥ÀÌÅÍÀÇ °³½Ã ¿ÀÇÁ¼Â(offset)len
- Ãâ·ÂÇØÁö´Â ¹ÙÀÌÆ®¼ö
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void flush() throws IOException
Flushable
³»ÀÇ flush
ObjectOutput
³»ÀÇ flush
OutputStream
³»ÀÇ flush
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìprotected void drain() throws IOException
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void close() throws IOException
Closeable
³»ÀÇ close
ObjectOutput
³»ÀÇ close
OutputStream
³»ÀÇ close
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeBoolean(boolean val) throws IOException
DataOutput
³»ÀÇ writeBoolean
val
- Ãâ·ÂÇØÁö´Â boolean Ä¡
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeByte(int val) throws IOException
DataOutput
³»ÀÇ writeByte
val
- Ãâ·ÂÇØÁö´Â ¹ÙÀÌÆ®°ª
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeShort(int val) throws IOException
DataOutput
³»ÀÇ writeShort
val
- Ãâ·ÂÇØÁö´Â short°ª
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeChar(int val) throws IOException
DataOutput
³»ÀÇ writeChar
val
- Ãâ·ÂÇØÁö´Â char°ª
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeInt(int val) throws IOException
DataOutput
³»ÀÇ writeInt
val
- Ãâ·ÂÇØÁö´Â int°ª
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeLong(long val) throws IOException
DataOutput
³»ÀÇ writeLong
val
- Ãâ·ÂÇØÁö´Â long°ª
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeFloat(float val) throws IOException
DataOutput
³»ÀÇ writeFloat
val
- Ãâ·ÂÇØÁö´Â float°ª
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeDouble(double val) throws IOException
DataOutput
³»ÀÇ writeDouble
val
- Ãâ·ÂÇØÁö´Â double°ª
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeBytes(String str) throws IOException
DataOutput
³»ÀÇ writeBytes
str
- Ãâ·ÂÇØÁö´Â ¹ÙÀÌÆ®ÀÇ Ä³¸¯ÅÍ ¶óÀÎ
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeChars(String str) throws IOException
DataOutput
³»ÀÇ writeChars
str
- Ãâ·ÂÇØÁö´Â char
ij¸¯ÅÍ ¶óÀÎ
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void writeUTF(String str) throws IOException
DataOutput
³»ÀÇ writeUTF
str
- Ãâ·ÂÇØÁö´Â ij¸¯ÅÍ ¶óÀÎ
IOException
- ±âº»ÀÌ µÇ´Â ½ºÆ®¸²ÀÇ Ãâ·ÂÁß¿¡ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.