Java Code Examples for com.esotericsoftware.kryo.io.Output#writeBoolean()

The following examples show how to use com.esotericsoftware.kryo.io.Output#writeBoolean() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NovelAdjacencyAndAltHaplotype.java    From gatk with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
protected void serialize(final Kryo kryo, final Output output) {
    output.writeString(leftJustifiedLeftRefLoc.getContig());
    output.writeInt(leftJustifiedLeftRefLoc.getStart());
    output.writeInt(leftJustifiedLeftRefLoc.getEnd());
    output.writeString(leftJustifiedRightRefLoc.getContig());
    output.writeInt(leftJustifiedRightRefLoc.getStart());
    output.writeInt(leftJustifiedRightRefLoc.getEnd());
    output.writeInt(strandSwitch.ordinal());

    kryo.writeClassAndObject(output, complication);

    output.writeInt(type.ordinal());

    if (altHaplotypeSequence==null) {
        output.writeBoolean(true);
    } else {
        output.writeBoolean(false);
        output.writeInt(altHaplotypeSequence.length);
        for (final byte b : altHaplotypeSequence) {
            output.writeByte(b);
        }
    }
}
 
Example 2
Source File: DefaultLinkSerializer.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public void write(Kryo kryo, Output output, DefaultLink object) {
    kryo.writeClassAndObject(output, object.providerId());
    kryo.writeClassAndObject(output, object.src());
    kryo.writeClassAndObject(output, object.dst());
    kryo.writeClassAndObject(output, object.type());
    kryo.writeClassAndObject(output, object.state());
    output.writeBoolean(object.isExpected());
}
 
Example 3
Source File: EventFields.java    From datawave with Apache License 2.0 5 votes vote down vote up
@Override
public void write(Kryo kryo, Output output) {
    // Write out the number of entries;
    output.writeInt(map.size(), true);
    
    for (Entry<String,FieldValue> entry : map.entries()) {
        // Write the key
        output.writeString(entry.getKey());
        
        // Write the fields in the value
        byte[] vis = entry.getValue().getVisibility().getExpression();
        
        if (vis == null) {
            vis = new byte[0];
        }
        
        output.writeInt(vis.length, true);
        output.write(vis);
        
        output.writeInt(entry.getValue().getValue().length, true);
        output.write(entry.getValue().getValue());
        
        if (null != entry.getValue().getContext()) {
            output.writeBoolean(true);
            output.writeString(entry.getValue().getContext());
        } else {
            output.writeBoolean(false);
        }
        
        if (null != entry.getValue().isHit()) {
            output.writeBoolean(true);
            output.writeBoolean(entry.getValue().isHit());
        } else {
            output.writeBoolean(false);
        }
    }
}
 
Example 4
Source File: BreakpointEvidence.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
protected void serialize( final Kryo kryo, final Output output ) {
    super.serialize(kryo, output);
    output.writeString(templateName);
    output.writeByte(fragmentOrdinal.ordinal());
    output.writeBoolean(forwardStrand);
    output.writeString(cigarString);
    output.writeInt(mappingQuality);
    output.writeInt(templateSize);
    output.writeString(readGroup);
}
 
Example 5
Source File: Attributes.java    From datawave with Apache License 2.0 5 votes vote down vote up
@Override
public void write(Kryo kryo, Output output, Boolean reducedResponse) {
    output.writeInt(this._count, true);
    output.writeBoolean(this.trackSizes);
    // Write out the number of Attributes we're going to store
    output.writeInt(this.attributes.size(), true);
    
    for (Attribute<? extends Comparable<?>> attr : this.attributes) {
        // Write out the concrete Attribute class
        output.writeString(attr.getClass().getName());
        
        // Defer to the concrete instance to write() itself
        attr.write(kryo, output, reducedResponse);
    }
}
 
Example 6
Source File: AlignedAssemblyOrExcuse.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private static void writeConnection( final Connection connection,
                                     final Map<Contig, Integer> contigMap,
                                     final Output output ) {
    output.writeInt(contigMap.get(connection.getTarget()));
    output.writeInt(connection.getOverlapLen());
    output.writeBoolean(connection.isRC());
    output.writeBoolean(connection.isTargetRC());
}
 
Example 7
Source File: WeightApproximateQuantile.java    From ytk-learn with MIT License 5 votes vote down vote up
@Override
public void write(Kryo kryo, Output output, Summary object) {
    output.writeInt(object.value.length);
    for (int i = 0; i < object.value.length; i++) {
        output.writeFloat(object.value[i]);
    }

    output.writeInt(object.rmin.length);
    for (int i = 0; i < object.rmin.length; i++) {
        output.writeDouble(object.rmin[i]);
    }

    output.writeInt(object.rmax.length);
    for (int i = 0; i < object.rmax.length; i++) {
        output.writeDouble(object.rmax[i]);
    }

    output.writeInt(object.w.length);
    for (int i = 0; i < object.w.length; i++) {
        output.writeFloat(object.w[i]);
    }

    output.writeInt(object.capacity);
    output.writeInt(object.cursor);
    output.writeDouble(object.B);
    output.writeBoolean(object.exact);
    output.writeDouble(object.eps);
}
 
Example 8
Source File: KryoSerialization.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void write(Kryo kryo, Output output, Collection collection) {
    boolean isNotInstantiated = collection instanceof IndirectContainer
            && !((IndirectContainer) collection).isInstantiated();
    output.writeBoolean(isNotInstantiated);
    if (!isNotInstantiated) {
        super.write(kryo, output, collection);
    }
}
 
Example 9
Source File: AssemblyContigWithFineTunedAlignments.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
void serialize(final Kryo kryo, final Output output) {
    contigSerializer.write(kryo, output, sourceTig);
    output.writeInt(insertionMappings.size());
    for (final String mapping : insertionMappings) {
        output.writeString(mapping);
    }
    output.writeBoolean(hasEquallyGoodAlnConfigurations);
   output.writeString(saTAGForGoodMappingToNonCanonicalChromosome);
}
 
Example 10
Source File: AlignmentInterval.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
void serialize(final Kryo kryo, final Output output) {
    output.writeString(referenceSpan.getContig());
    output.writeInt(referenceSpan.getStart());
    output.writeInt(referenceSpan.getEnd());
    output.writeInt(startInAssembledContig);
    output.writeInt(endInAssembledContig);
    output.writeString(TextCigarCodec.encode(cigarAlong5to3DirectionOfContig));
    output.writeBoolean(forwardStrand);
    output.writeInt(mapQual);
    output.writeInt(mismatches);
    output.writeInt(alnScore);
    output.writeInt(alnModType.ordinal());
}
 
Example 11
Source File: AlignedAssemblyOrExcuse.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private static void writeContig( final Contig contig, final Output output ) {
    output.writeInt(contig.getSequence().length);
    output.writeBytes(contig.getSequence());
    final boolean hasCoverage = contig.getPerBaseCoverage() != null;
    output.writeBoolean(hasCoverage);
    if ( hasCoverage ) output.writeBytes(contig.getPerBaseCoverage());
    output.writeInt(contig.getNSupportingReads());
}
 
Example 12
Source File: AttributeContentEvent.java    From incubator-samoa with Apache License 2.0 5 votes vote down vote up
@Override
public void write(Kryo kryo, Output output, AttributeContentEvent event) {
  output.writeLong(event.learningNodeId, true);
  output.writeInt(event.obsIndex, true);
  output.writeDouble(event.attrVal, PRECISION, true);
  output.writeInt(event.classVal, true);
  output.writeDouble(event.weight, PRECISION, true);
  output.writeBoolean(event.isNominal);
}
 
Example 13
Source File: DataValueDescriptorSerializer.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void write(Kryo kryo, Output output, T object) {
    output.writeBoolean(object.isNull());
    if(!object.isNull()){
        try{
            writeValue(kryo, output, object);
        }catch(StandardException se){
            throw new RuntimeException(se);
        }
    }
}
 
Example 14
Source File: BitSetSerializer.java    From kylin with Apache License 2.0 5 votes vote down vote up
@Override
public void write(final Kryo kryo, final Output output, final BitSet bitSet) {
    final int len = bitSet.length();

    output.writeInt(len, true);

    for (int i = 0; i < len; i++) {
        output.writeBoolean(bitSet.get(i));
    }
}
 
Example 15
Source File: PortNumberSerializer.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public void write(Kryo kryo, Output output, PortNumber object) {
    output.writeBoolean(object.hasName());
    output.writeLong(object.toLong());
    if (object.hasName()) {
        output.writeString(object.name());
    }
}
 
Example 16
Source File: IntervalCoverageFinder.java    From gatk with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected void serialize( final Kryo kryo, final Output output ) {
    intervalSerializer.write(kryo, output, interval);
    output.writeBoolean(containsMaxCoveragePeak);
}
 
Example 17
Source File: ActivationSerializer.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void write (Kryo kryo, Output out) {
    out.writeBoolean(data);
}
 
Example 18
Source File: PyBooleanSerializer.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public void write(Kryo kryo, Output output, PyBoolean object) {
	output.writeBoolean(object.getBooleanValue());
}
 
Example 19
Source File: BreakpointEvidence.java    From gatk with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
protected void serialize( final Kryo kryo, final Output output ) {
    super.serialize(kryo, output);
    output.writeInt(mateStartPosition);
    output.writeBoolean(mateReverseStrand);
}
 
Example 20
Source File: BreakpointEvidence.java    From gatk with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
protected void serialize( final Kryo kryo, final Output output ) {
    super.serialize(kryo, output);
    output.writeString(tagSA);
    output.writeBoolean(primaryAlignmentClippedAtStart);
}