private void setupBufferedOutput() {
    OutputStream pdataOut;
    if (test) {
      pdataOut = System.out;
    } else {
      pdataOut = new FileOutputStream(FileDescriptor.out);
    }
    BufferedOutputStream bos =
        new BufferedOutputStream(pdataOut, STDOUT_BUFFER_SIZE);
    PrintStream ps =
        new PrintStream(bos, false);
    System.setOut(ps);
  }
Print record to string builder
@param value
@param buf
@throws IOException
cli/src/java/org/apache/hadoop/hive/cli/RCFileCat.java