Java Code Examples for java.io.DataOutput#writeUTF()
The following examples show how to use
java.io.DataOutput#writeUTF() .
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: JGenProg2017_00141_t.java From coming with MIT License | 6 votes |
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, DataOutput out) throws IOException { // pass false so zone id is not written out DateTimeZone zone = toDateTimeZone(zoneID, false); if (zone instanceof FixedDateTimeZone) { out.writeByte('F'); // 'F' for fixed out.writeUTF(zone.getNameKey(0)); writeMillis(out, zone.getOffset(0)); writeMillis(out, zone.getStandardOffset(0)); } else { if (zone instanceof CachedDateTimeZone) { out.writeByte('C'); // 'C' for cached, precalculated zone = ((CachedDateTimeZone)zone).getUncachedZone(); } else { out.writeByte('P'); // 'P' for precalculated, uncached } ((PrecalculatedZone)zone).writeTo(out); } }
Example 2
Source File: jKali_0040_t.java From coming with MIT License | 6 votes |
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, DataOutput out) throws IOException { // pass false so zone id is not written out DateTimeZone zone = toDateTimeZone(zoneID, false); if (zone instanceof FixedDateTimeZone) { out.writeByte('F'); // 'F' for fixed out.writeUTF(zone.getNameKey(0)); writeMillis(out, zone.getOffset(0)); writeMillis(out, zone.getStandardOffset(0)); } else { if (zone instanceof CachedDateTimeZone) { out.writeByte('C'); // 'C' for cached, precalculated zone = ((CachedDateTimeZone)zone).getUncachedZone(); } else { out.writeByte('P'); // 'P' for precalculated, uncached } ((PrecalculatedZone)zone).writeTo(out); } }
Example 3
Source File: DataKeyList.java From mr4c with Apache License 2.0 | 5 votes |
public void write(DataOutput out) throws IOException { out.writeInt(m_keys.size()); for ( DataKey key : m_keys ) { String serializedKey = m_serializer.serializeDataKey(key); out.writeUTF(serializedKey); } }
Example 4
Source File: SerializerUtils.java From cacheonix-core with GNU Lesser General Public License v2.1 | 5 votes |
public static void writeString(final String string, final DataOutput out) throws IOException { if (string == null) { out.writeBoolean(true); } else { out.writeBoolean(false); out.writeUTF(string); } }
Example 5
Source File: Phase.java From datawave with Apache License 2.0 | 5 votes |
@Override public void write(DataOutput out) throws IOException { out.writeUTF(name); VLongWritable vlaw = new VLongWritable(); vlaw.set(start); vlaw.write(out); vlaw.set(end); vlaw.write(out); }
Example 6
Source File: VHDataSerializable.java From gemfirexd-oss with Apache License 2.0 | 5 votes |
public static void myToData(BaseValueHolder vh, DataOutput out) throws IOException { out.writeUTF(vh.myVersion); writeObject(out, vh.myValue); writeObject(out, vh.extraObject); if (vh.modVal == null) { out.writeUTF("null"); } else { out.writeUTF(vh.modVal.toString()); } }
Example 7
Source File: ModuleData.java From netbeans with Apache License 2.0 | 5 votes |
private void writeStrings(DataOutput dos, Collection<String> set) throws IOException { if (set == null) { dos.writeInt(0); return; } dos.writeInt(set.size()); for (String s : set) { dos.writeUTF(s); } }
Example 8
Source File: AnalyticsRequestManager.java From lucene-solr with Apache License 2.0 | 5 votes |
/** * Export the shard data for this request through a bit-stream, * to be imported by the {@link #importShardData} method in the originating shard. * <p> * First the overall data is exported, then the grouping data is exported. * * @param output The bit-stream to output the shard data through * @throws IOException if an exception occurs while writing to the {@link DataOutput} */ public void exportShardData(DataOutput output) throws IOException { ungroupedReductionManager.setShardOutput(output); ungroupedReductionManager.prepareReductionDataIO(ungroupedData); ungroupedReductionManager.exportData(); output.writeInt(groupingManagers.size()); for (Map.Entry<String, AnalyticsGroupingManager> entry : groupingManagers.entrySet()) { output.writeUTF(entry.getKey()); entry.getValue().exportShardData(output); } }
Example 9
Source File: ShrunkenDictionary.java From kylin with Apache License 2.0 | 4 votes |
@Override public void writeValue(DataOutput out, String value) throws IOException { out.writeUTF(value); }
Example 10
Source File: Elixir_0038_s.java From coming with MIT License | 4 votes |
public void writeTo(DataOutput out) throws IOException { iOfYear.writeTo(out); out.writeUTF(iNameKey); writeMillis(out, iSaveMillis); }
Example 11
Source File: MetricDumpSerialization.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
private static void serializeMeter(DataOutput out, QueryScopeInfo info, String name, Meter meter) throws IOException { serializeMetricInfo(out, info); out.writeUTF(name); out.writeDouble(meter.getRate()); }
Example 12
Source File: ZoneRegion.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
void writeExternal(DataOutput out) throws IOException { out.writeUTF(id); }
Example 13
Source File: TimeOutputValue.java From BigDataPlatform with GNU General Public License v3.0 | 4 votes |
@Override public void write(DataOutput dataOutput) throws IOException { dataOutput.writeUTF(this.id); dataOutput.writeLong(this.time); }
Example 14
Source File: RecurrentLayeredNeuralNetwork.java From incubator-retired-horn with Apache License 2.0 | 4 votes |
@Override public void write(DataOutput output) throws IOException { super.write(output); output.writeInt(finalLayerIdx); output.writeFloat(dropRate); // write neuron classes output.writeInt(this.neuronClassList.size()); for (Class<? extends Neuron<?>> clazz : this.neuronClassList) { output.writeUTF(clazz.getName()); } // write squashing functions output.writeInt(this.squashingFunctionList.size()); for (FloatFunction aSquashingFunctionList : this.squashingFunctionList) { WritableUtils.writeString(output, aSquashingFunctionList.getFunctionName()); } // write recurrent step size output.writeInt(this.recurrentStepSize); // write recurrent step size output.writeInt(this.numOutCells); // write recurrent layer list output.writeInt(this.recurrentLayerList.size()); for (Boolean isReccurentLayer: recurrentLayerList) { output.writeBoolean(isReccurentLayer); } // write weight matrices output.writeInt(this.getSizeOfWeightmatrix()); for (List<FloatMatrix> aWeightMatrixLists : this.weightMatrixLists) { for (FloatMatrix aWeightMatrixList : aWeightMatrixLists) { FloatMatrixWritable.write(aWeightMatrixList, output); } } // DO NOT WRITE WEIGHT UPDATE }
Example 15
Source File: ProjectStatePersister.java From n4js with Eclipse Public License 1.0 | 4 votes |
private void writeQualifiedName(QualifiedName qualifiedName, DataOutput output) throws IOException { output.writeInt(qualifiedName.getSegmentCount()); for (int i = 0, max = qualifiedName.getSegmentCount(); i < max; i++) { output.writeUTF(qualifiedName.getSegment(i)); } }
Example 16
Source File: JGenProg2017_0042_s.java From coming with MIT License | 4 votes |
public void writeTo(DataOutput out) throws IOException { iOfYear.writeTo(out); out.writeUTF(iNameKey); writeMillis(out, iSaveMillis); }
Example 17
Source File: CSVIntermediateDataFormat.java From sqoop-on-spark with Apache License 2.0 | 4 votes |
/** * {@inheritDoc} */ @Override public void write(DataOutput out) throws IOException { out.writeUTF(this.data); }
Example 18
Source File: GroupMax.java From MapReduce-Demo with MIT License | 4 votes |
@Override public void write(DataOutput out) throws IOException { // TODO Auto-generated method stub out.writeUTF(order_id); out.writeDouble(amount.get()); }
Example 19
Source File: LWHiveInputFormat.java From hive-solr with Apache License 2.0 | 4 votes |
@Override public void write(DataOutput out) throws IOException { out.writeUTF(path.toString()); inputSplit.write(out); }
Example 20
Source File: Nopol2015_0010_t.java From coming with MIT License | 4 votes |
public void writeTo(DataOutput out) throws IOException { int size = iTransitions.length; // Create unique string pool. Set<String> poolSet = new HashSet<String>(); for (int i=0; i<size; i++) { poolSet.add(iNameKeys[i]); } int poolSize = poolSet.size(); if (poolSize > 65535) { throw new UnsupportedOperationException("String pool is too large"); } String[] pool = new String[poolSize]; Iterator<String> it = poolSet.iterator(); for (int i=0; it.hasNext(); i++) { pool[i] = it.next(); } // Write out the pool. out.writeShort(poolSize); for (int i=0; i<poolSize; i++) { out.writeUTF(pool[i]); } out.writeInt(size); for (int i=0; i<size; i++) { writeMillis(out, iTransitions[i]); writeMillis(out, iWallOffsets[i]); writeMillis(out, iStandardOffsets[i]); // Find pool index and write it out. String nameKey = iNameKeys[i]; for (int j=0; j<poolSize; j++) { if (pool[j].equals(nameKey)) { if (poolSize < 256) { out.writeByte(j); } else { out.writeShort(j); } break; } } } out.writeBoolean(iTailZone != null); if (iTailZone != null) { iTailZone.writeTo(out); } }