title: Forcing interface implementation to check for exception
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4088114/c-sharp-explicitly-defining-what-exceptions-are-thrown">C# explicitly defining what exceptions are thrown</a>  </p>
  </blockquote>
  
  
  
  <p>I have a piece of Java code like this:</p>
  
  <pre><code>public interface ByteSource
  {
      public void open() throws IOException;
      public void close();
      public byte readByte() throws IOException;
      public void writeBytes(byte[] bytes) throws IOException;
  }
  </code></pre>
  
  <p>I am no Java expert (nor .NET one!) and I want to make a similar interface for <code>.NET</code> but I am not sure what to do about <code>throws ....</code>. I would like to know what does this means in Java language.</p>
  
  <p>Should I care about it? At the moment the best thing (Or only thing I can think of) will be look like:</p>
  
  <pre><code>public interface IByteSource
  {
      void Open();
      void Close();
      byte ReadByte();
      void WriteBytes(byte[] bytes);
  }
  </code></pre>
  
  <p>Is there an approach in .NET similar to the java code?! Maybe some attributes ?!</p>