@@ -0,0 +1,2573 @@
+package tachyon.util.io;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0A/**%0A * Unit tests for %7B@link ByteIOUtils%7D%0A */%0Apublic class ByteIOUtilsTest %7B%0A  private byte%5B%5D mBuf = new byte%5B1024%5D;%0A%0A  @Test%0A  public void readWriteByteTest() throws Exception %7B%0A    long%5B%5D values = new long%5B%5D %7B0, 1, 2, 0x7f, 0xff%7D;%0A    for (long i : values) %7B%0A      byte v = (byte) i;%0A      ByteIOUtils.writeByte(mBuf, 0, v);%0A      Assert.assertEquals(v, ByteIOUtils.readByte(mBuf, 0));%0A    %7D%0A  %7D%0A%0A  @Test%0A  public void readWriteShortTest() throws Exception %7B%0A    long%5B%5D values = new long%5B%5D %7B0, 1, 2, 0x7f, 0xff, 0xffff%7D;%0A    for (long i : values) %7B%0A      short v = (short) i;%0A      ByteIOUtils.writeShort(mBuf, 0, v);%0A      Assert.assertEquals(v, ByteIOUtils.readShort(mBuf, 0));%0A      ByteIOUtils.writeShort(mBuf, 1, v);%0A      Assert.assertEquals(v, ByteIOUtils.readShort(mBuf, 1));%0A    %7D%0A  %7D%0A%0A  @Test%0A  public void readWriteIntTest() throws Exception %7B%0A    long%5B%5D values = new long%5B%5D %7B0, 1, 2, 0x7f, 0xff, 0xffff, 0xffffff, 0xffffffff%7D;%0A    for (long i : values) %7B%0A      int v = (int) i;%0A      ByteIOUtils.writeInt(mBuf, 0, v);%0A      Assert.assertEquals(v, ByteIOUtils.readInt(mBuf, 0));%0A      ByteIOUtils.writeInt(mBuf, 1, v);%0A      Assert.assertEquals(v, ByteIOUtils.readInt(mBuf, 1));%0A      ByteIOUtils.writeInt(mBuf, 2, v);%0A      Assert.assertEquals(v, ByteIOUtils.readInt(mBuf, 2));%0A      ByteIOUtils.writeInt(mBuf, 3, v);%0A      Assert.assertEquals(v, ByteIOUtils.readInt(mBuf, 3));%0A    %7D%0A  %7D%0A%0A  @Test%0A  public void readWriteLongTest() throws Exception %7B%0A    long%5B%5D values =%0A        new long%5B%5D %7B0, 1, 2, 0x7f, 0xff, 0xffff, 0xffffff, 0xffffffff, 0xffffffffffL,%0A            0xffffffffffffL, 0xffffffffffffffL, 0xffffffffffffffffL%7D;%0A    for (long v : values) %7B%0A      ByteIOUtils.writeLong(mBuf, 0, v);%0A      Assert.assertEquals(v, ByteIOUtils.readLong(mBuf, 0));%0A      ByteIOUtils.writeLong(mBuf, 1, v);%0A      Assert.assertEquals(v, ByteIOUtils.readLong(mBuf, 1));%0A      ByteIOUtils.writeLong(mBuf, 2, v);%0A      Assert.assertEquals(v, ByteIOUtils.readLong(mBuf, 2));%0A      ByteIOUtils.writeLong(mBuf, 3, v);%0A      Assert.assertEquals(v, ByteIOUtils.readLong(mBuf, 3));%0A      ByteIOUtils.writeLong(mBuf, 4, v);%0A      Assert.assertEquals(v, ByteIOUtils.readLong(mBuf, 4));%0A      ByteIOUtils.writeLong(mBuf, 5, v);%0A      Assert.assertEquals(v, ByteIOUtils.readLong(mBuf, 5));%0A      ByteIOUtils.writeLong(mBuf, 6, v);%0A      Assert.assertEquals(v, ByteIOUtils.readLong(mBuf, 6));%0A      ByteIOUtils.writeLong(mBuf, 7, v);%0A      Assert.assertEquals(v, ByteIOUtils.readLong(mBuf, 7));%0A    %7D%0A  %7D%0A%0A%0A%7D%0A

Add unit tests to ByteIOUtils