当前位置: 首页>>代码示例>>Java>>正文


Java DataOutputStream.writeUTF方法代码示例

本文整理汇总了Java中java.io.DataOutputStream.writeUTF方法的典型用法代码示例。如果您正苦于以下问题:Java DataOutputStream.writeUTF方法的具体用法?Java DataOutputStream.writeUTF怎么用?Java DataOutputStream.writeUTF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.DataOutputStream的用法示例。


在下文中一共展示了DataOutputStream.writeUTF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import java.io.DataOutputStream; //导入方法依赖的package包/类
public void write(final DataOutputStream dataOutputStream) {
	try {
		dataOutputStream.writeUTF(this.name);
		
		doWriteFloatArray(dataOutputStream, this.boundingVolumeHierarchy);
		doWriteFloatArray(dataOutputStream, this.camera);
		doWriteFloatArray(dataOutputStream, this.point2s);
		doWriteFloatArray(dataOutputStream, this.point3s);
		doWriteFloatArray(dataOutputStream, this.shapes);
		doWriteFloatArray(dataOutputStream, this.surfaces);
		doWriteFloatArray(dataOutputStream, this.textures);
		doWriteFloatArray(dataOutputStream, this.vector3s);
		doWriteIntArray(dataOutputStream, this.shapeOffsets);
	} catch(final IOException e) {
		throw new UncheckedIOException(e);
	}
}
 
开发者ID:macroing,项目名称:Dayflower-Path-Tracer,代码行数:18,代码来源:CompiledScene.java

示例2: initialConnect

import java.io.DataOutputStream; //导入方法依赖的package包/类
private static void initialConnect(Socket javaSocket, NetJavaSocketImpl gdxSocket) throws Exception {
  javaSocket.setSoTimeout(TIMEOUT);
  DataInputStream dataInputStream = new DataInputStream(javaSocket.getInputStream());
  byte b = dataInputStream.readByte();
  DataOutputStream dataOutputStream = new DataOutputStream(javaSocket.getOutputStream());
  dataOutputStream.writeInt(Branding.VERSION_MAJOR);
  dataOutputStream.writeInt(Branding.VERSION_MINOR);
  dataOutputStream.writeInt(Branding.VERSION_POINT);
  dataOutputStream.writeInt(Branding.VERSION_BUILD);
  dataOutputStream.writeUTF(Branding.VERSION_HASH);
  switch (b) {
    case 0:
      connect(javaSocket, gdxSocket, dataOutputStream, dataInputStream);
      return;
    case 1:
      ping(javaSocket, gdxSocket, dataOutputStream, dataInputStream);
      return;
    default:
      throw new IOException("Unrecognised connection code " + b);
  }
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:22,代码来源:ServerConnectionInitializer.java

示例3: writeTo

import java.io.DataOutputStream; //导入方法依赖的package包/类
/**
 * Writes the parameter set to an output stream
 *
 * @param os an output stream
 * @throws java.io.IOException
 */
public void writeTo(OutputStream os)
    throws IOException
{
    DataOutputStream dos = new DataOutputStream(os);
    dos.writeInt(N);
    dos.writeInt(q);
    dos.writeInt(d);
    dos.writeInt(d1);
    dos.writeInt(d2);
    dos.writeInt(d3);
    dos.writeInt(B);
    dos.writeInt(basisType);
    dos.writeDouble(beta);
    dos.writeDouble(normBound);
    dos.writeDouble(keyNormBound);
    dos.writeInt(signFailTolerance);
    dos.writeBoolean(primeCheck);
    dos.writeBoolean(sparse);
    dos.writeInt(bitsF);
    dos.write(keyGenAlg);
    dos.writeUTF(hashAlg.getAlgorithmName());
    dos.write(polyType);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:30,代码来源:NTRUSigningKeyGenerationParameters.java

示例4: writeNetworkCellData

import java.io.DataOutputStream; //导入方法依赖的package包/类
private void writeNetworkCellData(OutputStream out, int cid, int lac, int mmc, int mnc) throws IOException {
    DataOutputStream dataOutputStream = new DataOutputStream(out);
    dataOutputStream.writeShort(21);
    dataOutputStream.writeLong(0);
    dataOutputStream.writeUTF("en");
    dataOutputStream.writeUTF("Android");
    dataOutputStream.writeUTF("1.0");
    dataOutputStream.writeUTF("Web");
    dataOutputStream.writeByte(27);
    dataOutputStream.writeInt(0);
    dataOutputStream.writeInt(0);
    dataOutputStream.writeInt(3);
    dataOutputStream.writeUTF("");

    dataOutputStream.writeInt(cid);
    dataOutputStream.writeInt(lac);

    dataOutputStream.writeInt(0);
    dataOutputStream.writeInt(0);
    dataOutputStream.writeInt(0);
    dataOutputStream.writeInt(0);
    dataOutputStream.flush();
}
 
开发者ID:fekracomputers,项目名称:MuslimMateAndroid,代码行数:24,代码来源:LocationTracker.java

示例5: encodeCertificate

import java.io.DataOutputStream; //导入方法依赖的package包/类
private void encodeCertificate(
    Certificate         cert,
    DataOutputStream    dOut)
    throws IOException
{
    try
    {
        byte[]      cEnc = cert.getEncoded();

        dOut.writeUTF(cert.getType());
        dOut.writeInt(cEnc.length);
        dOut.write(cEnc);
    }
    catch (CertificateEncodingException ex)
    {
        throw new IOException(ex.toString());
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:BcKeyStoreSpi.java

示例6: write

import java.io.DataOutputStream; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:ProxyGenerator.java

示例7: saveInternals

import java.io.DataOutputStream; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void saveInternals(final File nodeInternDir,
        final ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {

    final String path = nodeInternDir.getAbsolutePath();

    final File file = new File(path + "LoopEndNode.intern");

    // save the defined classes
    final DataOutputStream os =
            new DataOutputStream(new FileOutputStream(file));

    os.writeInt(m_classModel.getSize());

    for (final String clsName : m_classModel.getDefinedClasses()) {
        os.writeUTF(clsName);
    }
    os.close();
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:24,代码来源:ActiveLearnLoopEndNodeModel.java

示例8: write

import java.io.DataOutputStream; //导入方法依赖的package包/类
public void write(DataOutputStream out, Object o) throws IOException
{
	Compound compound = (Compound) o;
	for(Map.Entry<String, Object> entry : compound.entrySet())
	{
		String name = entry.getKey();
		Object e = entry.getValue();
		TagType type = getType(e);
		
		out.write(type.id);
		out.writeUTF(name);
		type.write(out, e);
	}
	out.write(0);
}
 
开发者ID:timtomtim7,项目名称:SparseBukkitAPI,代码行数:16,代码来源:TagType.java

示例9: writeMessage

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
protected void writeMessage(OutputStream out) throws IOException {
  super.writeMessage(out);
  DataOutputStream dos = new DataOutputStream(out);
  for (int i = 0; i < topics.size(); i++) {
    dos.writeUTF(topics.get(i));
    dos.write(topicQoSs.get(i).getValue());
  }
  dos.flush();
}
 
开发者ID:osswangxining,项目名称:mqttserver,代码行数:11,代码来源:SubscribeMessage.java

示例10: writeToEntropyPool

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
protected void writeToEntropyPool(DataOutputStream out) throws IOException {
	super.writeToEntropyPool(out);
	out.writeInt(android.os.Process.myPid());
	out.writeInt(android.os.Process.myTid());
	out.writeInt(android.os.Process.myUid());
	if (Build.FINGERPRINT != null) out.writeUTF(Build.FINGERPRINT);
	if (Build.SERIAL != null) out.writeUTF(Build.SERIAL);
	ContentResolver contentResolver = appContext.getContentResolver();
	String id = Settings.Secure.getString(contentResolver, ANDROID_ID);
	if (id != null) out.writeUTF(id);
	Parcel parcel = Parcel.obtain();
	WifiManager wm =
			(WifiManager) appContext.getSystemService(WIFI_SERVICE);
	List<WifiConfiguration> configs = wm.getConfiguredNetworks();
	if (configs != null) {
		for (WifiConfiguration config : configs)
			parcel.writeParcelable(config, 0);
	}
	BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter();
	if (bt != null) {
		for (BluetoothDevice device : bt.getBondedDevices())
			parcel.writeParcelable(device, 0);
	}
	out.write(parcel.marshall());
	parcel.recycle();
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:28,代码来源:AndroidSecureRandomProvider.java

示例11: Save

import java.io.DataOutputStream; //导入方法依赖的package包/类
boolean Save(DataOutputStream F){    //Guarda la tupla al flujo F. Si hay error, return false.
    try{
        F.writeUTF(NombreID);
        F.writeInt(ValorI);
        F.writeInt(ValorF);
        F.writeInt(CantTmp);
        return true;
    } catch(Exception e){}
    
    return false;
}
 
开发者ID:mariocordova,项目名称:codigo3,代码行数:12,代码来源:Tupla.java

示例12: sendQueuePosition

import java.io.DataOutputStream; //导入方法依赖的package包/类
private void sendQueuePosition(DataOutputStream out, int queued, String message)
        throws IOException {
    RobustMML mml = new RobustMML();

    mml.put(QUEUED_PATH, "" + queued); //no queing
    if (!message.equals(""))
        mml.put(MESSAGE_PATH, message);

    out.writeUTF("" + mml); //this would loop until 1
    
    out.flush();

    fireEvent(ServerDownloadEvent.QUEUED, queued);
}
 
开发者ID:addertheblack,项目名称:myster,代码行数:15,代码来源:MultiSourceSender.java

示例13: save

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
public void save(DataOutputStream out) throws Exception
{
    out.writeInt(id2tag.length);
    for (String tag : id2tag)
    {
        out.writeUTF(tag);
    }
    FeatureFunction[] valueArray = featureFunctionTrie.getValueArray(new FeatureFunction[0]);
    out.writeInt(valueArray.length);
    for (FeatureFunction featureFunction : valueArray)
    {
        featureFunction.save(out);
    }
    featureFunctionTrie.save(out);
    out.writeInt(featureTemplateList.size());
    for (FeatureTemplate featureTemplate : featureTemplateList)
    {
        featureTemplate.save(out);
    }
    if (matrix != null)
    {
        out.writeInt(matrix.length);
        for (double[] line : matrix)
        {
            for (double v : line)
            {
                out.writeDouble(v);
            }
        }
    }
    else
    {
        out.writeInt(0);
    }
}
 
开发者ID:priester,项目名称:hanlpStudy,代码行数:37,代码来源:CRFModel.java

示例14: getBytesFromStrings

import java.io.DataOutputStream; //导入方法依赖的package包/类
public byte[] getBytesFromStrings(String[] addressesAsStrings) throws IOException {
    ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
    DataOutputStream out = new DataOutputStream(byteOutputStream);

    for (int i = 0; i < addressesAsStrings.length; i++) {
        out.writeUTF(addressesAsStrings[i]);
    }

    out.writeUTF("");

    return byteOutputStream.toByteArray();
}
 
开发者ID:addertheblack,项目名称:myster,代码行数:13,代码来源:TopTenDatagramServer.java

示例15: store

import java.io.DataOutputStream; //导入方法依赖的package包/类
@Override
public void store(FileSystem fs, List<URL> urls, OutputStream os) throws IOException {
    DataOutputStream data = new DataOutputStream(os);
    for (URL u : urls) {
        data.writeUTF(u.toExternalForm());
    }
    data.close();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:LayerCacheManager.java


注:本文中的java.io.DataOutputStream.writeUTF方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。