|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | »ý¼ºÀÚ | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
public interface ScatteringByteChannel
¹öÆÛ ¼ø¼¿¡ ¹ÙÀÌÆ®¸¦ ÀоîµéÀÏ ¼ö Àִ ä³ÎÀÔ´Ï´Ù.
¡¸ºÐ»ê¡¹read Á¶ÀÛÀº 1ȸ
ÀÇ È£Ãâ·Î ÁöÁ¤µÈ ¹öÆÛ ¼ø¼ (º¹¼ö°¡´É)¿¡ ´ÜÀÏÀÇ ¹ÙÀÌÆ® ¼ø¼¸¦ ÀоîµéÀÔ´Ï´Ù. º¸Åë, ºÐ»ê read´Â ƯÁ¤ÀÇ ³×Æ®¿öÅ© ÇÁ·ÎÅäÄÝÀ̳ª ÆÄÀÏ Çü½Ä (µ¥ÀÌÅ͸¦ 1°³
ÀÌ»óÀÇ °íÁ¤Àå Çì´õ¿Í °¡º¯ÀåÀÇ º»Ã¼·ÎºÎÅÍ µÇ´Â ¼¼±×¸ÕÆ®(segment)¿¡ Á¤¸®ÇÏ´Â ±â´ÉÀ» °¡Áö´Â °Í µî)À» ±¸ÇöÇÏ´Â °æ¿ì¿¡ µµ¿òÀÌ µË´Ï´Ù. À̰Ϳ¡ À¯»çÇÑ ¡¸ÁýÁß¡¹Ãâ·Â Á¶ÀÛÀº, GatheringByteChannel
ÀÎÅÍÆäÀ̽º·Î Á¤Àǵǰí ÀÖ½À´Ï´Ù.
¸Þ¼µå °³¿ä | |
---|---|
long |
read (ByteBuffer [] dsts)
ÀÌ Ã¤³ÎÀÇ ¹ÙÀÌÆ® ¼ø¼°¡ ÁöÁ¤µÈ ¹öÆÛ¿¡ ÀоîµéÀÔ´Ï´Ù. |
long |
read (ByteBuffer [] dsts,
int offset,
int length)
ÀÌ Ã¤³ÎÀÇ ¹ÙÀÌÆ® ¼ø¼°¡ ÁöÁ¤µÈ ¹öÆÛÀÇ ¼ºê ¼ø¼¿¡ ÀоîµéÀÔ´Ï´Ù. |
ÀÎÅÍÆäÀ̽º java.nio.channels. ReadableByteChannel ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
read |
ÀÎÅÍÆäÀ̽º java.nio.channels. Channel ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
close,
isOpen |
¸Þ¼µåÀÇ »ó¼¼ |
---|
long read(ByteBuffer [] dsts, int offset, int length) throws IOException
ÀÌ ¸Þ¼µå È£ÃâÀº ÀÌ Ã¤³Î·ÎºÎÅÍ ÃÖ´ë r ¹ÙÀÌÆ®¸¦ Àо·Á°í ÇÕ´Ï´Ù. r´Â ÀÌ ¸Þ¼µåÀÇ È£Ãâ½Ã·Î ÁöÁ¤µÈ ¹öÆÛ ¹è¿ÀÇ ÁöÁ¤µÈ ¼ºê ¼ø¼¿¡ Æ÷ÇԵǴ ÇÕ°è ¹ÙÀÌÆ®¼öÀÔ´Ï´Ù.
dsts[offset]. remaining() + dsts[offset+1]. remaining() + ... + dsts[offset+length-1]. remaining()
±æÀÌ n (0 <= n <= r)ÀÇ ¹ÙÀÌÆ® ¼ø¼°¡ ÀоÁø´Ù°í ÇÕ´Ï´Ù. ÀÌ ¼ø¼ÀÇ ÃÖÃÊÀÇ dsts[offset]. remaining() ¹ÙÀÌÆ®±îÁö°¡ ¹öÆÛ dsts[offset]¿¡ Àü¼Û µÇ¾î ´ÙÀ½ÀÇ dsts[offset+1]. remaining() ¹ÙÀÌÆ®±îÁö°¡ ¹öÆÛ dsts[offset+1]¿¡ Àü¼Û µË´Ï´Ù. ÀÌ Ã³¸®´Â ¸ðµç ¹ÙÀÌÆ® ¼ø¼°¡ ÁöÁ¤µÈ ¹öÆÛ¿¡ Àü¼Û µÉ ¶§±îÁö ¹Ýº¹ÇØÁý´Ï´Ù. °¢ ¹öÆÛ¿¡´Â ÃÖ´ëÇÑÀÇ ¹ÙÀÌÆ®°¡ Àü¼Û µÇ±â ¶§¹®¿¡ ÃÖÁ¾ °»½Å ¹öÆÛ¸¦ Á¦¿ÜÇÑ °³°³ÀÇ °»½Å ¹öÆÛÀÇ ÃÖÁ¾ÀûÀÎ À§Ä¡´Â ÀÌ ¹öÆÛÀÇ ¸®¹ÔÆ®¿Í µ¿ÀÏÇØÁý´Ï´Ù.
ÀÌ ¸Þ¼µå´Â ¾ðÁ¦¶óµµ È£ÃâÇÒ ¼ö ÀÖ½À´Ï´Ù. ´Ù¸¸, ´Ù¸¥ thread°¡ ÀÌ Ã¤³Î¿¡ ´ëÇØ¼ Àбâ Á¶ÀÛÀ» °³½ÃÇϰí ÀÖ´Â °æ¿ì, ÀÌ ¸Þ¼µåÀÇ È£ÃâÀº ÃÖÃÊÀÇ Á¶ÀÛÀÌ ³¡³¯ ¶§±îÁö ºí·Ï µË´Ï´Ù.
dsts
- ¹ÙÀÌÆ®ÀÇ Àü¼Ûó ¹öÆÛoffset
- ÃÖÃÊÀÇ ¹ÙÀÌÆ®ÀÇ Àü¼Ûó°¡ µÇ´Â ¹öÆÛ ¹è¿³»ÀÇ ¿ÀÇÁ¼Â(offset). dsts.length ¾Æ·¡ÀÇ Á¦·Î ¶Ç´Â Á¤ÀÇ ¼ölength
- ¾×¼¼½º °¡´ÉÇÑ ÃÖ´ë ¹öÆÛ¼ö. dsts.length - offset ¾Æ·¡ÀÇ Á¦·Î ¶Ç´Â Á¤ÀÇ ¼ö
IndexOutOfBoundsException
- offset ÆÄ¶ó¹ÌÅÍ¿Í length ÆÄ¶ó¹ÌÅÍÀÇ ÀüÁ¦ Á¶°ÇÀÌ Ã¤¿öÁöÁö ¾ÊÀº °æ¿ì
NonReadableChannelException
- ÀÌ Ã¤³ÎÀÌ Àбâ
°¡´ÉÇÏÁö ¾ÊÀº °æ¿ì
ClosedChannelException
- ÀÌ Ã¤³ÎÀÌ Å¬·Î¿ìÁî Çϰí ÀÖ´Â °æ¿ì
AsynchronousCloseException
- read Á¶ÀÛÀÇ ÁøÇàÁß¿¡
´Ù¸¥ thread¿¡ ÀÇÇØ ÀÌ Ã¤³ÎÀÌ Å¬·Î¿ìÁî µÇ¾úÀ» °æ¿ì
ClosedByInterruptException
- read Á¶ÀÛÀÇ ÁøÇàÁß¿¡ ´Ù¸¥ thread·ÎºÎÅÍÀÇ ÀÎÅÍ·´Æ®°¡ ÀÖ¾ú±â ¶§¹®¿¡ ä³ÎÀÌ Å¬·Î¿ìÁî ÇØ, ÇöÀçÀÇ threadÀÇ ÀÎÅÍ·´Æ® »óŰ¡ ¼³Á¤µÇ¾úÀ» °æ¿ì
IOException
- ±× ¿ÜÀÇ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ìlong read(ByteBuffer [] dsts) throws IOException
ÀÌ ¸Þ¼µå¸¦ c.read(dsts) Çü½Ä¿¡¼ È£ÃâÇßÀ» °æ¿ì, ´ÙÀ½ÀÇ È£Ãâ°ú °°Àº °á°ú¸¦ ¾òÀ» ¼ö ÀÖ½À´Ï´Ù.
c.read(dsts, 0, srcs.length);
dsts
- ¹ÙÀÌÆ®ÀÇ Àü¼Ûó ¹öÆÛ
NonReadableChannelException
- ÀÌ Ã¤³ÎÀÌ Àбâ
°¡´ÉÇÏÁö ¾ÊÀº °æ¿ì
ClosedChannelException
- ÀÌ Ã¤³ÎÀÌ Å¬·Î¿ìÁî Çϰí ÀÖ´Â °æ¿ì
AsynchronousCloseException
- read Á¶ÀÛÀÇ ÁøÇàÁß¿¡
´Ù¸¥ thread¿¡ ÀÇÇØ ÀÌ Ã¤³ÎÀÌ Å¬·Î¿ìÁî µÇ¾úÀ» °æ¿ì
ClosedByInterruptException
- read Á¶ÀÛÀÇ ÁøÇàÁß¿¡ ´Ù¸¥ thread·ÎºÎÅÍÀÇ ÀÎÅÍ·´Æ®°¡ ÀÖ¾ú±â ¶§¹®¿¡ ä³ÎÀÌ Å¬·Î¿ìÁî ÇØ, ÇöÀçÀÇ threadÀÇ ÀÎÅÍ·´Æ® »óŰ¡ ¼³Á¤µÇ¾úÀ» °æ¿ì
IOException
- ±× ¿ÜÀÇ ÀÔÃâ·Â ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | »ý¼ºÀÚ | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.