20-CS-694 Advanced Programming Techniques Spring 2012
Networking - Protocol Handler

Interfaces, Exceptions, Graphics, Animation, Threads, Reflection, Networking, RMI, JDBC, JNI

Prev     Next     CryptInputStream.java     CryptURLConnection.java
Prev     Next     Handler.java     Rotate.java     ProtoTest.java      All lectures

Protocol Handler - CryptInputStream.java

This class file is placed in protocolhandlers/crypt.

package protocolhandlers.crypt;
import  java.io.*;

abstract class CryptInputStream extends InputStream {
   InputStream in;
   OutputStream out;
   abstract public void set (InputStream in, OutputStream out);
}

class rotateCryptInputStream extends CryptInputStream {

   public rotateCryptInputStream () {
      System.out.println("rotateCryptInputStream object created");
   }

   public void set (InputStream in, OutputStream out) {
      System.out.println("rotateCryptInputStream: set():");
      this.in = new Rotate(in);
   }
   
   public int read () throws IOException {
      return in.read();
   }
}