Example usage for org.apache.hadoop.io DataOutputOutputStream constructOutputStream

List of usage examples for org.apache.hadoop.io DataOutputOutputStream constructOutputStream

Introduction

In this page you can find the example usage for org.apache.hadoop.io DataOutputOutputStream constructOutputStream.

Prototype

public static OutputStream constructOutputStream(DataOutput out) 

Source Link

Document

Construct an OutputStream from the given DataOutput.

Usage

From source file:org.bigsolr.hadoop.SolrRecord.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    log.debug("SolrRecord -> write");

    JavaBinCodec codec = new JavaBinCodec();
    FastOutputStream os = FastOutputStream.wrap(DataOutputOutputStream.constructOutputStream(out));
    codec.init(os);/*from  ww  w . ja v  a 2 s .  com*/
    try {
        codec.writeVal(sd);
    } finally {
        os.flushBuffer();
    }
}