Example usage for java.io DataOutput writeBoolean

List of usage examples for java.io DataOutput writeBoolean

Introduction

In this page you can find the example usage for java.io DataOutput writeBoolean.

Prototype

void writeBoolean(boolean v) throws IOException;

Source Link

Document

Writes a boolean value to this output stream.

Usage

From source file:mobi.hsz.idea.gitignore.indexing.IgnoreEntryOccurrence.java

/**
 * Static helper to write given {@link IgnoreEntryOccurrence} to the output stream.
 *
 * @param out   output stream//from   ww  w  .ja  va  2 s  .c om
 * @param entry entry to write
 * @throws IOException I/O exception
 */
public static synchronized void serialize(@NotNull DataOutput out, @NotNull IgnoreEntryOccurrence entry)
        throws IOException {
    out.writeUTF(entry.getFile().getPath());
    out.writeInt(entry.items.size());
    for (Pair<Pattern, Boolean> item : entry.items) {
        out.writeUTF(item.first.pattern());
        out.writeBoolean(item.second);
    }
}

From source file:com.bigdata.dastor.utils.FBUtilities.java

public static void writeNullableString(String key, DataOutput dos) throws IOException {
    dos.writeBoolean(key == null);
    if (key != null) {
        dos.writeUTF(key);//from   w  w w.j  a va 2s  .c  o  m
    }
}

From source file:com.chinamobile.bcbsp.ml.VectorWritable.java

public static void writeVector(DoubleVector vector, DataOutput out) throws IOException {
    if (vector == null) {
        LOG.info("lin test : VectorWritable write Vector is null");
    } else {//from   ww  w. ja v a  2s  . c  o m
        LOG.info("lin test : VectorWritable write Vector is not null");
    }
    out.writeInt(vector.getLength());
    for (int i = 0; i < vector.getDimension(); i++) {
        out.writeDouble(vector.get(i));
    }

    if (vector.isNamed() && vector.getName() != null) {
        out.writeBoolean(true);
        out.writeUTF(vector.getName());
    } else {
        out.writeBoolean(false);
    }
}

From source file:com.splicemachine.derby.impl.sql.execute.operations.SpliceBaseOperation.java

public static void writeNullableString(String value, DataOutput out) throws IOException {
    if (value != null) {
        out.writeBoolean(true);
        out.writeUTF(value);//w  w  w .  j a  v  a2 s . c  o  m
    } else {
        out.writeBoolean(false);
    }
}

From source file:org.pivotal.customer.versonix.support.PaxReserveType.java

@Override
public void toData(DataOutput out) throws IOException {
    out.writeUTF(id);
    out.writeBoolean(linked);
}

From source file:ipc.ConnectionHeader.java

@Override
public void write(DataOutput out) throws IOException {
    Text.writeString(out, (protocol == null) ? "" : protocol);
    out.writeBoolean(false);
}

From source file:IndexService.IColumnInputSplit.java

@Override
public void write(DataOutput out) throws IOException {
    out.writeUTF(file.toString());//  w w w. j a v  a 2s  .  com
    out.writeBoolean(splitbyline);
    out.writeBoolean(this.wholefileASasplit);
    if (splitbyline) {
        if (!wholefileASasplit) {
            out.writeInt(beginline);
            out.writeInt(recnum);
        }
    } else {
        beginkey.write(out);
        out.writeInt(recnum);
    }
}

From source file:com.twitter.hraven.etl.JobFile.java

@Override
public void write(DataOutput out) throws IOException {
    Text.writeString(out, filename);
    Text.writeString(out, jobid);
    out.writeBoolean(isJobConfFile);
    out.writeBoolean(isJobHistoryFile);/*from  w w w.  j  a  v  a2 s . c  o  m*/
}

From source file:com.cloudera.sqoop.lib.LobRef.java

@Override
public void write(DataOutput out) throws IOException {
    out.writeBoolean(isExternal());
    if (isExternal()) {
        Text.writeString(out, "lf"); // storage type "lf" for LobFile.
        Text.writeString(out, fileName);
        out.writeLong(offset);/*  ww w . j a  v a2  s  .  c  o  m*/
        out.writeLong(length);
    } else {
        writeInternal(out);
    }
}

From source file:com.mongodb.hadoop.io.MongoUpdateWritable.java

/**
        // w  ww  .  j  a v a  2s  .  c  om
/**
 * {@inheritDoc}
 *
 * @see Writable#write(DataOutput)
 */
public void write(DataOutput out) throws IOException {
    enc.set(buf);
    enc.putObject(this.query);
    enc.done();
    buf.pipe(out);
    enc.set(buf);
    enc.putObject(this.modifiers);
    enc.done();
    out.writeBoolean(this.upsert);
    out.writeBoolean(this.multiUpdate);
}