닫힌 채널 예외

닫힌 채널 예외 (ClosedChannelException)

닫힌 채널에 대해 I/O 연산을 시도할 때 던져지는 checked 예외예요. 닫힌 채널 계열 예외의 기반입니다.

출처: Java API Reference

본문

ClosedChannelException은 닫힌 채널에 대해 I/O 연산을 시도할 때 던져지는 checked exception이에요.

public class ClosedChannelException extends IOException

채널이 닫힌 뒤에는 어떤 I/O 연산도 수행할 수 없고, 시도하면 이 예외가 발생합니다. IOException을 상속하므로 checked exception이며, try-catch 또는 throws로 처리해야 해요. AsynchronousCloseExceptionClosedByInterruptException이 이 예외를 상속합니다.

더 알아보기 (Learn more)