From f67ad9e68a390a7096d0d657f7c7d6ad884c611f Mon Sep 17 00:00:00 2001 From: David Reiss Date: Thu, 4 Sep 2008 18:23:29 +0000 Subject: [PATCH] THRIFT-130. java: Eliminate frame{Read,Write} from TFramedTransport git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@692185 13f79535-47bb-0310-9956-ffa450edef68 --- .../thrift/transport/TFramedTransport.java | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java b/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java index e7dfcef7..dbb9e5f2 100644 --- a/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java +++ b/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java @@ -33,16 +33,6 @@ public class TFramedTransport extends TTransport { */ 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 @@ public class TFramedTransport extends TTransport { * 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 class TFramedTransport extends TTransport { } 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 class TFramedTransport extends TTransport { } 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(); -- 2.17.1