Author: dreiss
Date: Thu Sep  4 11:23:29 2008
New Revision: 692185

URL: http://svn.apache.org/viewvc?rev=692185&view=rev
Log:
THRIFT-130. java: Eliminate frame{Read,Write} from TFramedTransport

Modified:
    
incubator/thrift/trunk/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java

Modified: 
incubator/thrift/trunk/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java?rev=692185&r1=692184&r2=692185&view=diff
==============================================================================
--- 
incubator/thrift/trunk/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java
 (original)
+++ 
incubator/thrift/trunk/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java
 Thu Sep  4 11:23:29 2008
@@ -33,16 +33,6 @@
    */
   private ByteArrayInputStream readBuffer_ = null;
 
-  /**
-   * Whether to frame input
-   */
-  private boolean frameRead_ = true;
-
-  /**
-   * Whether to frame output
-   */
-  private boolean frameWrite_ = true;
-
   public static class Factory extends TTransportFactory {
     public Factory() {
     }
@@ -56,24 +46,7 @@
    * Constructor wraps around another tranpsort
    */
   public TFramedTransport(TTransport transport) {
-    this(transport, true, true);
-  }
-
-  /**
-   * Constructor wraps around another tranpsort
-   */
-  public TFramedTransport(TTransport transport, boolean in, boolean out) {
     transport_ = transport;
-    frameRead_ = in;
-    frameWrite_ = out;
-  }
-
-  public void setFrameRead(boolean frameRead) {
-    frameRead_ = frameRead;
-  }
-
-  public void setFrameWrite(boolean frameWrite) {
-    frameWrite_ = frameWrite;
   }
 
   public void open() throws TTransportException {
@@ -89,10 +62,6 @@
   }
 
   public int read(byte[] buf, int off, int len) throws TTransportException {
-    if (!frameRead_) {
-      return transport_.read(buf, off, len);
-    }
-
     if (readBuffer_ != null) {
       int got = readBuffer_.read(buf, off, len);
       if (got > 0) {
@@ -121,19 +90,10 @@
   }
 
   public void write(byte[] buf, int off, int len) throws TTransportException {
-    if (!frameWrite_) {
-      transport_.write(buf, off, len);
-      return;
-    }
     writeBuffer_.write(buf, off, len);
   }
 
   public void flush() throws TTransportException {
-    if (!frameWrite_) {
-      transport_.flush();
-      return;
-    }
-
     byte[] buf = writeBuffer_.get();
     int len = writeBuffer_.len();
     writeBuffer_.reset();


Reply via email to