Java Code Examples for com.esotericsoftware.kryo.io.Input#readBoolean()

The following examples show how to use com.esotericsoftware.kryo.io.Input#readBoolean() . 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: Pair.java    From gatk with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private Pair(Kryo kryo, Input input){
    super(input.readInt(true), input.readString());

    // Information used to detect optical dupes
    tile = -1;
    x = -1;
    y = -1;
    libraryId = -1;

    score = input.readShort();

    isRead1ReverseStrand = input.readBoolean();

    isRead2ReverseStrand = input.readBoolean();

    readGroupIndex = input.readShort();
    wasFlipped = input.readBoolean();
}
 
Example 2
Source File: EventFields.java    From datawave with Apache License 2.0 5 votes vote down vote up
@Override
public void read(Kryo kryo, Input input) {
    // Read in the number of map entries
    int entries = input.readInt(true);
    
    for (int i = 0; i < entries; i++) {
        // Read in the key
        String key = input.readString();
        
        // Read in the fields in the value
        int numBytes = input.readInt(true);
        ColumnVisibility vis = new ColumnVisibility(input.readBytes(numBytes));
        
        numBytes = input.readInt(true);
        byte[] value = input.readBytes(numBytes);
        
        FieldValue fv = new FieldValue(vis, value);
        
        boolean hasContext = input.readBoolean();
        if (hasContext) {
            fv.setContext(input.readString());
        }
        
        boolean hasIsHit = input.readBoolean();
        if (hasIsHit) {
            fv.setHit(input.readBoolean());
        }
        
        map.put(key, fv);
    }
    
}
 
Example 3
Source File: AlignedAssemblyOrExcuse.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private static Connection readConnection( final Input input, final List<Contig> contigs ) {
    final Contig target = contigs.get(input.readInt());
    final int overlapLen = input.readInt();
    final boolean isRC = input.readBoolean();
    final boolean isTargetRC = input.readBoolean();
    return new Connection(target, overlapLen, isRC, isTargetRC);
}
 
Example 4
Source File: ProviderIdSerializer.java    From onos with Apache License 2.0 5 votes vote down vote up
@Override
public ProviderId read(Kryo kryo, Input input, Class<ProviderId> type) {
    String scheme = input.readString();
    String id = input.readString();
    boolean isAncillary = input.readBoolean();
    return new ProviderId(scheme, id, isAncillary);
}
 
Example 5
Source File: AssemblyContigWithFineTunedAlignments.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
AssemblyContigWithFineTunedAlignments(final Kryo kryo, final Input input) {
    sourceTig = contigSerializer.read(kryo, input, AlignedContig.class);
    final int insertionMappingsSize = input.readInt();
    insertionMappings = new ArrayList<>(insertionMappingsSize);
    for (int i = 0; i < insertionMappingsSize; ++i) {
        insertionMappings.add(input.readString());
    }

    hasEquallyGoodAlnConfigurations = input.readBoolean();
    saTAGForGoodMappingToNonCanonicalChromosome = input.readString();
}
 
Example 6
Source File: AlignmentInterval.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
AlignmentInterval(final Kryo kryo, final Input input) {
    final String chr = input.readString();
    final int refStart = input.readInt(),
            refEnd = input.readInt();
    referenceSpan = new SimpleInterval(chr, refStart, refEnd);
    startInAssembledContig = input.readInt();
    endInAssembledContig = input.readInt();
    cigarAlong5to3DirectionOfContig = TextCigarCodec.decode(input.readString());
    forwardStrand = input.readBoolean();
    mapQual = input.readInt();
    mismatches = input.readInt();
    alnScore = input.readInt();
    alnModType = ContigAlignmentsModifier.AlnModType.values()[input.readInt()];
}
 
Example 7
Source File: BreakpointEvidence.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * a technical constructor for use in Kryo (de-)serialization.
 * this creates an object by reading a Kryo-serialized stream.
 * it will be called by subclasses in their own constructors from Kryo streams (as super(kryo, input)).
 */
protected ReadEvidence( final Kryo kryo, final Input input ) {
    super(kryo, input);
    this.templateName = input.readString();
    this.fragmentOrdinal = TemplateFragmentOrdinal.values()[input.readByte()];
    this.forwardStrand = input.readBoolean();
    this.cigarString = input.readString();
    this.mappingQuality = input.readInt();
    this.templateSize = input.readInt();
    this.readGroup = input.readString();
}
 
Example 8
Source File: BreakpointComplications.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
InvertedDuplicationBreakpointComplications(final Kryo kryo, final Input input) {
    super(kryo, input);
    String ctg = input.readString();
    int start = input.readInt();
    int end = input.readInt();
    dupSeqRepeatUnitRefSpan = new SimpleInterval(ctg, start, end);
    dupSeqRepeatNumOnRef = input.readInt();
    dupSeqRepeatNumOnCtg = input.readInt();
    dupSeqStrandOnRef = new ArrayList<>(dupSeqRepeatNumOnRef);
    for (int i=0; i<dupSeqRepeatNumOnRef; ++i) {
        dupSeqStrandOnRef.add(Strand.values()[input.readInt()]);
    }
    dupSeqStrandOnCtg = new ArrayList<>(dupSeqRepeatNumOnCtg);
    for (int i=0; i<dupSeqRepeatNumOnCtg; ++i) {
        dupSeqStrandOnCtg.add(Strand.values()[input.readInt()]);
    }
    final int cigarCounts = input.readInt();
    cigarStringsForDupSeqOnCtg = new ArrayList<>(cigarCounts);
    for(int i = 0; i < cigarCounts; ++i) {
        cigarStringsForDupSeqOnCtg.add(input.readString());
    }
    dupAnnotIsFromOptimization = input.readBoolean();
    if (input.readBoolean()) {
        ctg = input.readString();
        start = input.readInt();
        end = input.readInt();
        invertedTransInsertionRefSpan = new SimpleInterval(ctg, start, end);
    }
}
 
Example 9
Source File: NovelAdjacencyAndAltHaplotype.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
protected NovelAdjacencyAndAltHaplotype(final Kryo kryo, final Input input) {
    final String contig1 = input.readString();
    final int start1 = input.readInt();
    final int end1 = input.readInt();
    this.leftJustifiedLeftRefLoc = new SimpleInterval(contig1, start1, end1);
    final String contig2 = input.readString();
    final int start2 = input.readInt();
    final int end2 = input.readInt();
    this.leftJustifiedRightRefLoc = new SimpleInterval(contig2, start2, end2);

    this.strandSwitch = StrandSwitch.values()[input.readInt()];

    this.complication = (BreakpointComplications) kryo.readClassAndObject(input);

    this.type = TypeInferredFromSimpleChimera.values()[ input.readInt() ];

    final boolean altSeqIsNull = input.readBoolean();
    if (altSeqIsNull) {
        altHaplotypeSequence = null;
    } else {
        final int arraySize = input.readInt();
        altHaplotypeSequence = new byte[arraySize];
        for (int i = 0 ; i < arraySize; ++i) {
            altHaplotypeSequence[i] = input.readByte();
        }
    }
}
 
Example 10
Source File: KryoSerialization.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public Object read(Kryo kryo, Input input, Class type) {
    boolean isNotInstantiated = input.readBoolean();
    if (!isNotInstantiated) {
        return super.read(kryo, input, type);
    } else {
        return new UnfetchedWeavedAttributeValueHolder();
    }
}
 
Example 11
Source File: Attribute.java    From datawave with Apache License 2.0 5 votes vote down vote up
protected void readMetadata(Kryo kryo, Input input) {
    boolean reducedResponse = input.readBoolean();
    
    if (!reducedResponse) {
        if (input.readBoolean()) {
            int size = input.readInt(true);
            
            this.setMetadata(new ColumnVisibility(input.readBytes(size)), input.readLong());
        } else {
            this.clearMetadata();
        }
    }
}
 
Example 12
Source File: RyaStatementSerializer.java    From rya with Apache License 2.0 4 votes vote down vote up
/**
 * Reads RyaStatement from {@link Input} stream
 * @param input - input stream that statement is read from
 * @return - statement read from input stream
 */
public static RyaStatement read(Input input){
    Preconditions.checkNotNull(input);
    String subject = input.readString();
    String predicate = input.readString();
    String objectType = input.readString();
    String objectValue = input.readString();
    RyaType value;
    if (objectType.equals(XMLSchema.ANYURI.toString())){
        value = new RyaIRI(objectValue);
    }
    else {
        value = new RyaType(VF.createIRI(objectType), objectValue);
    }
    RyaStatement statement = new RyaStatement(new RyaIRI(subject), new RyaIRI(predicate), value);
    int length = 0;
    boolean hasNextValue = input.readBoolean();
    if (hasNextValue){
        statement.setContext(new RyaIRI(input.readString()));
    }
    hasNextValue = input.readBoolean();
    if (hasNextValue){
        length = input.readInt();
        statement.setColumnVisibility(input.readBytes(length));
    }
    hasNextValue = input.readBoolean();
    if (hasNextValue){
        statement.setQualifer(input.readString());
    }
    hasNextValue = input.readBoolean();
    if (hasNextValue){
        statement.setTimestamp(input.readLong());
    }
    hasNextValue = input.readBoolean();
    if (hasNextValue){
        length = input.readInt();
        statement.setValue(input.readBytes(length));
    }

    return statement;
}
 
Example 13
Source File: ActivationSerializer.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void read (Kryo kryo, Input in) {
    this.isIndexType = in.readBoolean();
    this.data = (ArrayFieldStorage)kryo.readClassAndObject(in);
}
 
Example 14
Source File: BreakpointEvidence.java    From gatk with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private WeirdTemplateSize( final Kryo kryo, final Input input ) {
    super(kryo, input);
    mateStartPosition = input.readInt();
    mateReverseStrand = input.readBoolean();
}
 
Example 15
Source File: NDArrayKryoSerializer.java    From attic-apex-malhar with Apache License 2.0 4 votes vote down vote up
@Override
public NDArray read(Kryo kryo, Input input, Class<NDArray> aClass)
{
  int singleDimensionArrayLength = input.readInt();
  int lengthOfDimensionsArray = input.readInt();
  int[] dimensions = input.readInts(lengthOfDimensionsArray);
  boolean signedFlag = input.readBoolean();

  String dataType = input.readString();
  if ( dataType == null) {
    return null;
  }
  switch (dataType) {
    case "float":
      NDArray<float[]> floatNDArray = new NDArray<>(
          input.readFloats(singleDimensionArrayLength),signedFlag,dimensions);
      return floatNDArray;
    case "int":
      NDArray<int[]> intNDArray = new NDArray<>(
          input.readInts(singleDimensionArrayLength),signedFlag,dimensions);
      return intNDArray;
    case "double":
      NDArray<double[]> doubleNDArray = new NDArray<>(
          input.readDoubles(singleDimensionArrayLength),signedFlag,dimensions);
      return doubleNDArray;
    case "long":
      NDArray<long[]> longNDArray = new NDArray<>(
          input.readLongs(singleDimensionArrayLength),signedFlag,dimensions);
      return longNDArray;
    case "short":
      NDArray<short[]> shortNDArray = new NDArray<>(
          input.readShorts(singleDimensionArrayLength),signedFlag,dimensions);
      return shortNDArray;
    case "byte":
      NDArray<byte[]> byteNDArray = new NDArray<>(
          input.readBytes(singleDimensionArrayLength),signedFlag,dimensions);
      return byteNDArray;
    case "boolean":
      short[] shortsArray = input.readShorts(singleDimensionArrayLength);
      boolean[] boolsArray = new boolean[shortsArray.length];
      for (int i = 0; i < shortsArray.length; i++) {
        if (TRUE_AS_SHORTINT == shortsArray[i]) {
          boolsArray[i] = true;
        } else {
          boolsArray[i] = false;
        }
      }
      NDArray<boolean[]> booleanNDArray = new NDArray<>(boolsArray,signedFlag,dimensions);
      return booleanNDArray;
    default:
      return null;
  }
}
 
Example 16
Source File: BreakpointEvidence.java    From gatk with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public DiscordantReadPairEvidence(final Kryo kryo, final Input input) {
    super(kryo, input);
    target = intervalSerializer.read(kryo, input, SVInterval.class);
    targetForwardStrand = input.readBoolean();
    targetQuality = input.readInt();
}
 
Example 17
Source File: BreakpointEvidence.java    From gatk with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private SplitRead( final Kryo kryo, final Input input ) {
    super(kryo, input);
    tagSA = input.readString();
    primaryAlignmentClippedAtStart = input.readBoolean();
    saMappings = parseSATag(tagSA);
}
 
Example 18
Source File: BreakpointEvidence.java    From gatk with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected BreakpointEvidence( final Kryo kryo, final Input input ) {
    this.location = intervalSerializer.read(kryo, input, SVInterval.class);
    this.weight = input.readInt();
    this.validated = input.readBoolean();
}
 
Example 19
Source File: PyBooleanSerializer.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public PyBoolean read(Kryo kryo, Input input, Class<PyBoolean> type) {
	return new PyBoolean(input.readBoolean());
}
 
Example 20
Source File: IntervalCoverageFinder.java    From gatk with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public CandidateCoverageInterval(final Kryo kryo, final Input input) {
    this.interval = intervalSerializer.read(kryo, input, SVInterval.class);
    this.containsMaxCoveragePeak = input.readBoolean();
}