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
diff --git a/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java b/lib/java/src/com/facebook/thrift/transport/TFramedTransport.java
index e7dfcef..dbb9e5f 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 @@
*/
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();