[WIP] [TACHYON-152] Client write refactor

Rewriting how client writes out blocks to make it easier to add remote blocks.

The current design is as follows:

Users requests access to a block

```java
Block block = Blocks.createBlock(tachyonFS, blockId, blockCapacityByte);
```

From there, the user can write to it by accessing its `Channel`.

```java
WritableBlockChannel channel = block.write();
channel.write(byteBuffer);
channel.close();
```

When the block is full, write returns -1, so you do this in a loop and create new blocks.

```java
while (buffer.remaining() > 0) {
  int n = mCurrentBlockChannel.write(buffer);
  if (n <= 0) {
    // block full, get new block
    getNextBlock();
  }
}
```
When it comes to this, I tend to follow what Joshua Bloch says on the
subject:
http://stackoverflow.com/questions/6129026/effective-java-by-joshua-bloch-item1-static-factory-method
On Sep 11, 2014 8:59 PM, "Jie Huang" <notifications@github.com> wrote:

> In core/src/main/java/tachyon/client/Blocks.java:
>
> > @@ -0,0 +1,17 @@
> > +package tachyon.client;
> > +
> > +import java.io.IOException;
> > +
> > +final class Blocks {
> > +  private Blocks() {
> > +
> > +  }
> > +
> > +  public static Block createBlock(TachyonFS tachyonFS, long currentBlockId, long maxBlockSize)
>
> how about to merge Blocks.java and Block.java as one class.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/427/files#r17462213>.
>