public boolean writeText(String fileName, int replicas, int lineCount)
            throws IOException {
        BufferedReader reader = new BufferedReader(new FileReader(fileName));
        DFSFile file = createFile(fileName, replicas);
        long offset = 0;
        int count = 0;
        StringBuffer sb = new StringBuffer();
        while(true){
            String line = reader.readLine();
            count++;
            if((line == null && sb.length() > 0) || count % lineCount == 0){
                if(line != null){
                    sb.append(line + "\n");
                }
                byte[] data = sb.toString().getBytes();
                DFSChunk chunk = createChunk(file.getId(), offset, data.length);
                if(chunk == null || !writeChunk(chunk, 0, data.length, data)){
                    return false;
                }
                offset += data.length;
                sb.delete(0, data.length);
            } else {
                sb.append(line + "\n");
            }
            if(line == null){
                break;
            }

        }
        reader.close();
        return true;
    }