Added writebytes optimization (removed copy) for java binarywriter