|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.io.Reader
java.io.InputStreamReader
public class InputStreamReader
InputStreamReader´Â ¹ÙÀÌÆ® ½ºÆ®¸²·ÎºÎÅÍ ¹®ÀÚ ½ºÆ®¸²¿¡ÀÇ Áß°³ÀÇ ¿ªÇÒÀ» °¡Á®, ¹ÙÀÌÆ® µ¥ÀÌÅ͸¦ Àбâ, ÁöÁ¤µÈ
¸¦
»ç¿ëÇØ ¹®ÀÚ·Î º¯È¯ÇÕ´Ï´Ù. »ç¿ëµÇ´Â ij¸¯Åͼ´ À̸§À¸·Î ÁöÁ¤ÇÏ´ÂÁö, ¸í½ÃÀûÀ¸·Î °Ç³×ÁÖ´ÂÁö, ¶Ç´Â Ç÷§ÆûÀÇ µðÆúÆ®ÀÇ Ä³¸¯Åͼ¸¦ ±×´ë·Î »ç¿ëÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
charset
InputStreamReader read() ¸Þ¼µåÀÇ ¾î¶² °ÍÀÎÁö¸¦ È£ÃâÇÒ ¶§¸¶´Ù, ±âº»ÀÌ µÇ´Â ¹ÙÀÌÆ® ÀÔ·Â ½ºÆ®¸²·ÎºÎÅÍ 1°³ ÀÌ»óÀÇ ¹ÙÀÌÆ®°¡ ÀÐÈü´Ï´Ù. ÇöÀçÀÇ ¹ÙÀÌÆ®·ÎºÎÅÍ ¹®ÀÚ¿¡ÀÇ È¿°úÀûÀÎ º¯È¯À» °¡´ÉÇÏ°Ô ÇÏ·Á¸é, read Á¶ÀÛÀ» ä¿ì´Âµ¥ ÇÊ¿äÇÑ ±âº»ÀÌ µÇ´Â ½ºÆ®¸²º¸´Ù, ¾ÕÀÇ ¹ÙÀÌÆ®¸¦ ÀоîµéÀÏ ¼ö°¡ ÀÖ½À´Ï´Ù.
º¯È¯ È¿À²À» ÃÖ°í·Î ÇÏ·Á¸é, ´ÙÀ½°ú °°Àº ¹æ¹ýÀ¸·Î BufferedReader ³»ºÎ¿¡ InputStreamReader¸¦ °¨½Î´Â °ÍÀ» °í·ÁÇØ ÁÖ¼¼¿ä.
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
BufferedReader
,
InputStream
,
Charset
ÇÊµå °³¿ä |
---|
Ŭ·¡½º java.io. Reader ·ÎºÎÅÍ »ó¼ÓµÈ Çʵå |
---|
lock |
»ý¼ºÀÚ °³¿ä | |
---|---|
InputStreamReader (InputStream in)
µðÆúÆ®ÀÇ Ä³¸¯Åͼ¸¦ »ç¿ëÇÏ´Â InputStreamReader¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
|
InputStreamReader (InputStream in,
Charset cs)
ÁÖ¾îÁø ij¸¯Åͼ¸¦ »ç¿ëÇÏ´Â InputStreamReader¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
|
InputStreamReader (InputStream in,
CharsetDecoder dec)
ÁÖ¾îÁø ij¸¯Åͼ µðÄÚ´õ¸¦ »ç¿ëÇÏ´Â InputStreamReader¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
|
InputStreamReader (InputStream in,
String charsetName)
ÁöÁ¤µÈ ij¸¯Åͼ¸¦ »ç¿ëÇÏ´Â InputStreamReader¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
void |
close ()
½ºÆ®¸²À» ´Ý½À´Ï´Ù. |
String |
getEncoding ()
ÀÌ ½ºÆ®¸²·Î »ç¿ëµÇ´Â ij¸¯ÅͼÂÀÇ À̸§À» ¸®ÅÏÇÕ´Ï´Ù. |
int |
read ()
´ÜÀÏÀÇ ¹®ÀÚ¸¦ ÀоîµéÀÔ´Ï´Ù. |
int |
read (char[] cbuf,
int offset,
int length)
¹è¿ÀÇ ÀϺο¡ ¹®ÀÚ¸¦ ÀоîµéÀÔ´Ï´Ù. |
boolean |
ready ()
½ºÆ®¸²ÀÌ Àб⠰¡´ÉÇÑ »óÅÂÀΰ¡ ¾î¶²°¡¸¦ ÅëÁöÇÕ´Ï´Ù. |
Ŭ·¡½º java.io. Reader ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
mark,
markSupported,
read,
read,
reset,
skip |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
»ý¼ºÀÚ »ó¼¼ |
---|
public InputStreamReader(InputStream in)
in
- InputStreampublic InputStreamReader(InputStream in, String charsetName) throws UnsupportedEncodingException
in
- InputStreamcharsetName
- Áö¿øÇÏ´Â charset
À̸§
UnsupportedEncodingException
- ÁöÁ¤µÈ ij¸¯Åͼ°¡ Áö¿øµÇ¾î ÀÖÁö ¾ÊÀº °æ¿ìpublic InputStreamReader(InputStream in, Charset cs)
in
- InputStreamcs
- charsetpublic InputStreamReader(InputStream in, CharsetDecoder dec)
in
- InputStreamdec
- ij¸¯Åͼ µðÄÚ´õ¸Þ¼µåÀÇ »ó¼¼ |
---|
public String getEncoding()
ÀÎÄÚµù¿¡ ȣȯ¸íÀÌ ÀÖ´Â °æ¿ì´Â ±× À̸§À» ¸®ÅÏÇÕ´Ï´Ù. ȣȯ¸íÀÌ ¾ø´Â °æ¿ì´Â ÀÎÄÚµùÀÇ Ç¥ÁظíÀ» ¸®ÅÏÇÕ´Ï´Ù.
ÀÌ ÀνºÅϽº°¡ InputStreamReader(InputStream, String)
»ý¼ºÀÚ¸¦ »ç¿ëÇØ ÀÛ¼ºµÇ°í ÀÖ´Â °æ¿ì, ±× »ý¼ºÀÚ¿¡°Ô °Ç³×Áø À̸§Àº ¾Æ´Ï°í, ÀÎÄÚµùÀÇ ÀÏÀǸíÀÌ ¸®Åϵ˴ϴÙ
. ÀÌ ¸Þ¼µå´Â ½ºÆ®¸²ÀÌ ´Ý°í ÀÖ´Â °æ¿ì, null
À»
µ¹·ÁÁÖ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
null
Charset
public int read() throws IOException
Reader
³»ÀÇ read
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic int read(char[] cbuf, int offset, int length) throws IOException
Reader
³»ÀÇ read
cbuf
- Àü¼Ûó ¹öÆÛoffset
- ¹®ÀÚÀÇ Æ÷ÇÔ °³½Ã ¿ÀÇÁ¼Â(offset)length
- ÀоîµéÀÌ´Â ¹®ÀÚÀÇ ÃÖ´ë¼ö
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic boolean ready() throws IOException
Reader
³»ÀÇ ready
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìpublic void close() throws IOException
Closeable
³»ÀÇ close
Reader
³»ÀÇ close
IOException
- ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.