类org.apache.hadoop.io.compress.CompressorStream源码实例Demo

下面列出了怎么用org.apache.hadoop.io.compress.CompressorStream的API类实例代码及写法,或者点击链接到github查看源代码。

@Override
/**
 * {@inheritDoc}
 */
public OutputStream writeBlobRecord(long claimedLen) throws IOException {
  finishRecord(); // finish any previous record.
  checkForNull(this.out);
  startRecordIndex();
  this.header.getStartMark().write(out);
  LOG.debug("Starting new record; id=" + curEntryId
      + "; claimedLen=" + claimedLen);
  WritableUtils.writeVLong(out, curEntryId);
  WritableUtils.writeVLong(out, claimedLen);
  this.curClaimedLen = claimedLen;
  this.userCountingOutputStream = new CountingOutputStream(
      new CloseShieldOutputStream(out));
  if (null == this.codec) {
    // No codec; pass thru the same OutputStream to the user.
    this.userOutputStream = this.userCountingOutputStream;
  } else {
    // Wrap our CountingOutputStream in a compressing OutputStream to
    // give to the user.
    this.compressor.reset();
    this.userOutputStream = new CompressorStream(
        this.userCountingOutputStream, compressor);
  }

  return this.userOutputStream;
}
 
源代码2 项目: hadoop   文件: FSImageFormatProtobuf.java
private void flushSectionOutputStream() throws IOException {
  if (codec != null) {
    ((CompressorStream) sectionOutputStream).finish();
  }
  sectionOutputStream.flush();
}
 
源代码3 项目: big-c   文件: FSImageFormatProtobuf.java
private void flushSectionOutputStream() throws IOException {
  if (codec != null) {
    ((CompressorStream) sectionOutputStream).finish();
  }
  sectionOutputStream.flush();
}
 
 类所在包
 类方法
 同包方法