@@ -0,0 +1,1621 @@
+package org.apache.thrift.transport;%0A%0Aimport java.util.Arrays;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class TestTMemoryInputTransport extends TestCase %7B%0A  public void testFresh() throws Exception %7B%0A    byte%5B%5D input_buf = new byte%5B%5D%7B1, 2, 3, 4, 5, 6, 7, 8, 9, 10%7D;%0A    TMemoryInputTransport trans = new TMemoryInputTransport(input_buf);%0A    assertEquals(0, trans.getBufferPosition());%0A    assertEquals(input_buf, trans.getBuffer());%0A    assertEquals(10, trans.getBytesRemainingInBuffer());%0A%0A    byte%5B%5D buf1 = new byte%5B4%5D;%0A    trans.readAll(buf1, 0, 4);%0A    assertTrue(Arrays.equals(new byte%5B%5D%7B1, 2, 3, 4%7D, buf1));%0A    assertEquals(4, trans.getBufferPosition());%0A    assertEquals(6, trans.getBytesRemainingInBuffer());%0A%0A    trans.consumeBuffer(2);%0A%0A    assertEquals(6, trans.getBufferPosition());%0A    assertEquals(4, trans.getBytesRemainingInBuffer());%0A%0A    trans.readAll(buf1, 0, 4);%0A    assertTrue(Arrays.equals(new byte%5B%5D%7B7, 8, 9, 10%7D, buf1));%0A    assertEquals(10, trans.getBufferPosition());%0A    assertEquals(0, trans.getBytesRemainingInBuffer());%0A  %7D%0A%0A  public void testReused() throws Exception %7B%0A    byte%5B%5D input_buf = new byte%5B%5D%7B1, 2, 3, 4, 5, 6, 7, 8, 9, 10%7D;%0A    TMemoryInputTransport trans = new TMemoryInputTransport(input_buf);%0A    assertEquals(0, trans.getBufferPosition());%0A    assertEquals(input_buf, trans.getBuffer());%0A    assertEquals(10, trans.getBytesRemainingInBuffer());%0A%0A    byte%5B%5D new_buf = new byte%5B%5D%7B10, 9, 8%7D;%0A    trans.reset(new_buf);%0A    assertEquals(0, trans.getBufferPosition());%0A    assertEquals(new_buf, trans.getBuffer());%0A    assertEquals(3, trans.getBytesRemainingInBuffer());%0A  %7D%0A%7D%0A

add a basic test for TMemoryInputTransport