Refine search
public void save(DataOutputStream out) throws Exception { out.writeInt(m); out.writeInt(n); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { out.writeDouble(A[i][j]); } } }
@Override public void save(DataOutputStream out) throws IOException { out.writeInt(size); for (int i = 0; i < size; i++) { out.writeInt(data[i]); } out.writeInt(linearExpandFactor); out.writeBoolean(exponentialExpanding); out.writeDouble(exponentialExpandFactor); }
@Override public void save(DataOutputStream out) throws Exception { out.writeInt(o.length); for (char c : o) { out.writeChar(c); } out.writeInt(w.length); for (double v : w) { out.writeDouble(v); } }
public static byte[] createAuthenticationDigest(String passcode,long t1,double q1) throws IOException, NoSuchAlgorithmException { ByteArrayOutputStream baos=new ByteArrayOutputStream(512); DataOutputStream out=new DataOutputStream(baos); byte[] digest=createDigest(passcode,t1,q1); out.writeLong(t1); out.writeDouble(q1); out.writeInt(digest.length); out.write(digest); out.flush(); return baos.toByteArray(); }
public void write(DataOutputStream dos) throws IOException { dos.writeFloat(mvfAnalysisWindowSizeInSeconds); dos.writeFloat(mvfAnalysisSkipSizeInSeconds); dos.writeFloat(f0AnalysisWindowSizeInSeconds); dos.writeFloat(f0AnalysisSkipSizeInSeconds); dos.writeInt(fftSize); dos.writeInt(numFilteringStages); dos.writeInt(medianFilterLength); dos.writeInt(movingAverageFilterLength); dos.writeFloat(numPeriodsInitialPitchEstimation); dos.writeDouble(cumulativeAmpThreshold); dos.writeDouble(maximumAmpThresholdInDB); dos.writeDouble(harmonicDeviationPercent); dos.writeDouble(sharpPeakAmpDiffInDB); dos.writeInt(minimumTotalHarmonics); dos.writeInt(maximumTotalHarmonics); dos.writeFloat(minimumVoicedFrequencyOfVoicing); dos.writeFloat(maximumVoicedFrequencyOfVoicing); dos.writeFloat(maximumFrequencyOfVoicingFinalShift); dos.writeFloat(runningMeanVoicingThreshold); dos.writeInt(lastCorrelatedHarmonicNeighbour); dos.writeDouble(vuvSearchMinHarmonicMultiplier); dos.writeDouble(vuvSearchMaxHarmonicMultiplier); dos.writeDouble(neighsPercent); }
public void write(DataOutputStream dos) throws IOException { dos.writeFloat(mvfAnalysisWindowSizeInSeconds); dos.writeFloat(mvfAnalysisSkipSizeInSeconds); dos.writeFloat(f0AnalysisWindowSizeInSeconds); dos.writeFloat(f0AnalysisSkipSizeInSeconds); dos.writeInt(fftSize); dos.writeInt(numFilteringStages); dos.writeInt(medianFilterLength); dos.writeInt(movingAverageFilterLength); dos.writeFloat(numPeriodsInitialPitchEstimation); dos.writeDouble(cumulativeAmpThreshold); dos.writeDouble(maximumAmpThresholdInDB); dos.writeDouble(harmonicDeviationPercent); dos.writeDouble(sharpPeakAmpDiffInDB); dos.writeInt(minimumTotalHarmonics); dos.writeInt(maximumTotalHarmonics); dos.writeFloat(minimumVoicedFrequencyOfVoicing); dos.writeFloat(maximumVoicedFrequencyOfVoicing); dos.writeFloat(maximumFrequencyOfVoicingFinalShift); dos.writeFloat(runningMeanVoicingThreshold); dos.writeInt(lastCorrelatedHarmonicNeighbour); dos.writeDouble(vuvSearchMinHarmonicMultiplier); dos.writeDouble(vuvSearchMaxHarmonicMultiplier); dos.writeDouble(neighsPercent); }
public void write(DataOutputStream out) throws IOException { if (value instanceof String) { out.writeByte(CONSTANT_UTF8); out.writeUTF((String) value); } else if (value instanceof Integer) { out.writeByte(CONSTANT_INTEGER); out.writeInt(((Integer) value).intValue()); } else if (value instanceof Float) { out.writeByte(CONSTANT_FLOAT); out.writeFloat(((Float) value).floatValue()); } else if (value instanceof Long) { out.writeByte(CONSTANT_LONG); out.writeLong(((Long) value).longValue()); } else if (value instanceof Double) { out.writeDouble(CONSTANT_DOUBLE); out.writeDouble(((Double) value).doubleValue()); } else { throw new InternalError("bogus value entry: " + value); } } }
public void write(DataOutputStream out) throws IOException { if (value instanceof String) { out.writeByte(CONSTANT_UTF8); out.writeUTF((String) value); } else if (value instanceof Integer) { out.writeByte(CONSTANT_INTEGER); out.writeInt(((Integer) value).intValue()); } else if (value instanceof Float) { out.writeByte(CONSTANT_FLOAT); out.writeFloat(((Float) value).floatValue()); } else if (value instanceof Long) { out.writeByte(CONSTANT_LONG); out.writeLong(((Long) value).longValue()); } else if (value instanceof Double) { out.writeDouble(CONSTANT_DOUBLE); out.writeDouble(((Double) value).doubleValue()); } else { throw new InternalError("bogus value entry: " + value); } } }
private static void writeMinMaxStrategy(MinMaxStrategy strategy, DataOutputStream dos) throws IOException { dos.writeInt(Strategy.MIN_MAX.ordinal()); dos.writeDouble(strategy.getMinRange()); dos.writeDouble(strategy.getMaxRange()); }
private static void writeLdc(LdcInsnNode lin, DataOutputStream dos) throws IOException { Object o = lin.cst; if (o instanceof Integer) { dos.writeShort(1); dos.writeInt((Integer)o); } else if (o instanceof Float) { dos.writeShort(2); dos.writeFloat((Float)o); } else if (o instanceof Long) { dos.writeShort(3); dos.writeLong((Long)o); } else if (o instanceof Double) { dos.writeShort(4); dos.writeDouble((Double)o); } else if (o instanceof String) { dos.writeShort(5); dos.writeUTF((String)o); } else if (o instanceof Type) { dos.writeShort(6); dos.writeUTF(((Type)o).getDescriptor()); } else { dos.writeShort(0); } }
private void initializeData(DataOutputStream out) throws IOException { /* Write out various test values NORMALLY */ out.write(new byte[] {-100, 100}); out.writeBoolean(true); out.writeBoolean(false); out.writeByte(100); out.writeByte(-100); out.writeByte((byte) 200); out.writeChar('a'); out.writeShort((short) -30000); out.writeShort((short) 50000); out.writeInt(0xCAFEBABE); out.writeLong(0xDEADBEEFCAFEBABEL); out.writeUTF("Herby Derby"); out.writeFloat(Float.intBitsToFloat(0xCAFEBABE)); out.writeDouble(Double.longBitsToDouble(0xDEADBEEFCAFEBABEL)); }
public static byte[] serialize(QDigest d) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream s = new DataOutputStream(bos); try { s.writeLong(d.size); s.writeDouble(d.compressionFactor); s.writeLong(d.capacity); s.writeInt(d.node2count.size()); for (long k : d.node2count.keySet()) { s.writeLong(k); s.writeLong(d.node2count.get(k)); } return bos.toByteArray(); } catch (IOException e) { // Should never happen throw new RuntimeException(e); } }
@Override public void save(DataOutputStream out) throws Exception out.writeInt(id2tag.length); for (String tag : id2tag) out.writeInt(valueArray.length); for (FeatureFunction featureFunction : valueArray) out.writeInt(featureTemplateList.size()); for (FeatureTemplate featureTemplate : featureTemplateList) out.writeDouble(v);
out.writeInt(m.correctionConstant); out.writeDouble(m.correctionParam); out.writeInt(numOutcomes); String[] outcomeLabels = new String[numOutcomes]; m.outcomeNames = outcomeLabels; out.writeInt(numOCTypes); int[][] outcomePatterns = new int[numOCTypes][]; for (int i = 0; i < numOCTypes; i++) out.writeDouble(contextParameters[k - 1]);
Class<?> type = slot.getField().getType(); if (type == int.class) { output.writeInt(fieldValue != null ? ((Integer) fieldValue).intValue() : 0); } else if (type == byte.class) { output.writeByte(fieldValue != null ? ((Byte) fieldValue).byteValue() : 0); output.writeFloat(fieldValue != null ? ((Float) fieldValue).floatValue() : 0); } else if (type == double.class) { output.writeDouble(fieldValue != null ? ((Double) fieldValue).doubleValue() : 0); } else {
if (componentType == int.class) { int[] intArray = (int[]) array; output.writeInt(intArray.length); for (int i = 0; i < intArray.length; i++) { output.writeInt(intArray[i]); output.writeInt(byteArray.length); output.write(byteArray, 0, byteArray.length); } else if (componentType == char.class) { output.writeInt(doubleArray.length); for (int i = 0; i < doubleArray.length; i++) { output.writeDouble(doubleArray[i]);
output.writeInt(val); output.writeDouble(val);
dos.writeInt( getType() ); dos.writeInt( name.length() ); dos.writeInt( getLength() ); dos.writeInt( getPrecision() ); dos.writeDouble( getNumber() ); break; case VALUE_TYPE_BOOLEAN:
output.writeChar(field.getChar(obj)); } else if (type == double.class) { output.writeDouble(field.getDouble(obj)); } else if (type == float.class) { output.writeFloat(field.getFloat(obj)); } else if (type == int.class) { output.writeInt(field.getInt(obj)); } else if (type == long.class) { output.writeLong(field.getLong(obj));
case VALUE_TYPE_STRING: if ( getString() == null ) { dos.writeInt( -1 ); // -1 == null string } else { String string = getString(); byte[] chars = string.getBytes( Const.XML_ENCODING ); dos.writeInt( chars.length ); dos.write( chars ); case VALUE_TYPE_BIGNUMBER: if ( getBigNumber() == null ) { dos.writeInt( -1 ); // -1 == null big number } else { String string = getBigNumber().toString(); dos.writeDouble( getNumber() ); break; case VALUE_TYPE_BOOLEAN: