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


Java ObjectOutput.writeUTF方法代码示例

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


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

示例1: writePrincipal

import java.io.ObjectOutput; //导入方法依赖的package包/类
public static void writePrincipal(GenericPrincipal p, ObjectOutput out) throws IOException {
	out.writeUTF(p.getName());
	out.writeBoolean(p.getPassword() != null);
	if (p.getPassword() != null)
		out.writeUTF(p.getPassword());
	String[] roles = p.getRoles();
	if (roles == null)
		roles = new String[0];
	out.writeInt(roles.length);
	for (int i = 0; i < roles.length; i++)
		out.writeUTF(roles[i]);
	boolean hasUserPrincipal = (p != p.getUserPrincipal() && p.getUserPrincipal() instanceof Serializable);
	out.writeBoolean(hasUserPrincipal);
	if (hasUserPrincipal)
		out.writeObject(p.getUserPrincipal());
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:17,代码来源:SerializablePrincipal.java

示例2: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void writeExternal( ObjectOutput out ) throws IOException
{
    if ( upName == null )
    {
        String message = "Cannot serialize a NULL Dn";
        LOG.error( message );
        throw new IOException( message );
    }

    // Write the UPName
    out.writeUTF( upName );

    // Write the RDNs.
    // First the number of RDNs
    out.writeInt( size() );

    // Loop on the RDNs
    for ( Rdn rdn : rdns )
    {
        rdn.writeExternal( out );
    }

    out.flush();
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:29,代码来源:Dn.java

示例3: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF((this.prefix != null) ? this.prefix : "");
    out.writeUTF(this.localName);
    // make sure m isn't null
    getMethod();
    out.writeUTF((this.owner != null) ?
             this.owner :
             this.m.getDeclaringClass().getName());
    out.writeUTF((this.name != null) ?
             this.name :
             this.m.getName());
    out.writeObject((this.types != null) ?
             this.types :
             ReflectionUtil.toTypeNameArray(this.m.getParameterTypes()));

}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:18,代码来源:FunctionMapperImpl.java

示例4: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
@Override
public void writeExternal(final ObjectOutput out) throws IOException {
    // write kernelFunction
    out.writeUTF(m_kernelFunction.getClass().getName());
    m_kernelFunction.writeExternal(out);

    // write trainingData
    // rows
    out.writeInt(m_rowCount);
    // columns
    out.writeInt(m_colCount);
    // data
    for (final double[] row : m_trainingData) {
        for (final double col : row) {
            out.writeDouble(col);
        }
    }

}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:20,代码来源:KernelCalculator.java

示例5: write

import java.io.ObjectOutput; //导入方法依赖的package包/类
/**
 * Write endpoint to output stream.
 */
public void write(ObjectOutput out) throws IOException {
    if (csf == null) {
        out.writeByte(FORMAT_HOST_PORT);
        out.writeUTF(host);
        out.writeInt(port);
    } else {
        out.writeByte(FORMAT_HOST_PORT_FACTORY);
        out.writeUTF(host);
        out.writeInt(port);
        out.writeObject(csf);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:TCPEndpoint.java

示例6: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
@Override
public void writeExternal(final ObjectOutput arg0) throws IOException {
    // call super method
    super.writeExternal(arg0);

    // write labels
    arg0.writeInt(m_labels.length);
    for (final String label : m_labels) {
        arg0.writeUTF(label);
    }

}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:13,代码来源:MultiClassKNFST.java

示例7: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
/**
 * This is the place where we serialize attributes, and all theirs
 * elements.
 * 
 * {@inheritDoc}
 */
@Override
public void writeExternal( ObjectOutput out ) throws IOException
{
    // Write the UPId
    out.writeUTF( upId );
    
    // Write the ID
    out.writeUTF( id );

    // Write the HR flag, if not null
    if ( isHR != null )
    {
        out.writeBoolean( true );
        out.writeBoolean( isHR );
    }
    else
    {
        out.writeBoolean( false );
    }

    // Write the number of values
    out.writeInt( size() );

    if ( size() > 0 )
    {
        // Write each value
        for ( Value value : values )
        {
            // Write the value
            value.writeExternal( out );
        }
    }

    out.flush();
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:42,代码来源:DefaultAttribute.java

示例8: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
/**
 * The object implements the writeExternal method to save its contents by
 * calling the methods of DataOutput for its primitive values or calling the
 * writeObject method of ObjectOutput for objects, strings and arrays.
 *
 * @throws IOException Includes any I/O exceptions that may occur
 */
public void writeExternal(ObjectOutput out) throws IOException {
    String s = toString(); // contains ASCII chars only
    // one-to-one correspondence between ASCII char and byte in UTF string
    if (s.length() <= 65535) { // 65535 is max length of UTF string
        out.writeUTF(s);
    } else {
        out.writeByte(0);
        out.writeByte(0);
        out.writeInt(s.length());
        out.write(s.getBytes());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:MimeType.java

示例9: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(this.expr);
    out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
            : "");
    out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
    out.writeObject(this.fnMapper);
    out.writeObject(this.varMapper);
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:10,代码来源:MethodExpressionImpl.java

示例10: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
    out.writeInt(size);
    out.writeInt(acsMode);
    out.writeObject(uuid);
    out.writeUTF(cache.getName());
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:8,代码来源:SparseDistributedVectorStorage.java

示例11: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(this.expr);
    out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
            : "");
    out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
    out.writeObject(this.fnMapper);
    out.writeObject(this.varMapper);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:MethodExpressionImpl.java

示例12: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(this.expr);
    out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
            : "");
    out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:8,代码来源:MethodExpressionLiteral.java

示例13: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
/**
 * Write out external representation for remote ref.
 */
public void writeExternal(ObjectOutput out) throws IOException
{
    RemoteRef localRef = ref;

    out.writeObject(id);
    if (localRef == null) {
        out.writeUTF("");
    } else {
        out.writeUTF(localRef.getRefClass(out));
        localRef.writeExternal(out);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:ActivatableRef.java

示例14: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeUTF((this.prefix != null) ? this.prefix : "");
	out.writeUTF(this.localName);
	// make sure m isn't null
	getMethod();
	out.writeUTF((this.owner != null) ? this.owner : this.m.getDeclaringClass().getName());
	out.writeUTF((this.name != null) ? this.name : this.m.getName());
	out.writeObject(
			(this.types != null) ? this.types : ReflectionUtil.toTypeNameArray(this.m.getParameterTypes()));

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:13,代码来源:FunctionMapperImpl.java

示例15: writeExternal

import java.io.ObjectOutput; //导入方法依赖的package包/类
@Override
public void writeExternal(ObjectOutput out) throws IOException {
	out.writeUTF(this.mark);
	out.writeObject(this.target);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:6,代码来源:JspMethodExpression.java


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