本文整理汇总了Java中java.io.ObjectInput.readUTF方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectInput.readUTF方法的具体用法?Java ObjectInput.readUTF怎么用?Java ObjectInput.readUTF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectInput
的用法示例。
在下文中一共展示了ObjectInput.readUTF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.prefix = in.readUTF();
if ("".equals(this.prefix)) this.prefix = null;
this.localName = in.readUTF();
this.owner = in.readUTF();
this.name = in.readUTF();
this.types = (String[]) in.readObject();
}
示例2: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
this.value = in.readObject();
String type = in.readUTF();
if (!"".equals(type)) {
this.expectedType = ReflectionUtil.forName(type);
}
}
示例3: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
this.expr = in.readUTF();
String type = in.readUTF();
if (!"".equals(type)) {
this.expectedType = ReflectionUtil.forName(type);
}
this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
.readObject()));
}
示例4: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
/**
* The object implements the readExternal method to restore its
* contents by calling the methods of DataInput for primitive
* types and readObject for objects, strings and arrays. The
* readExternal method must read the values in the same sequence
* and with the same types as were written by writeExternal.
* @exception ClassNotFoundException If the class for an object being
* restored cannot be found.
*/
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
String s = in.readUTF();
if (s == null || s.length() == 0) { // long mime type
byte[] ba = new byte[in.readInt()];
in.readFully(ba);
s = new String(ba);
}
try {
parse(s);
} catch(MimeTypeParseException e) {
throw new IOException(e.toString());
}
}
示例5: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.value = in.readObject();
String type = in.readUTF();
if (!"".equals(type)) {
this.expectedType = ReflectionUtil.forName(type);
}
}
示例6: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.expr = in.readUTF();
String type = in.readUTF();
if (!"".equals(type)) {
this.expectedType = ReflectionUtil.forName(type);
}
this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
.readObject()));
this.fnMapper = (FunctionMapper) in.readObject();
this.varMapper = (VariableMapper) in.readObject();
}
示例7: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.expr = in.readUTF();
String type = in.readUTF();
if (!"".equals(type)) {
this.expectedType = ReflectionUtil.forName(type);
}
this.fnMapper = (FunctionMapper) in.readObject();
this.varMapper = (VariableMapper) in.readObject();
}
示例8: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
this.expr = in.readUTF();
String type = in.readUTF();
if (!"".equals(type)) {
this.expectedType = ReflectionUtil.forName(type);
}
this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
.readObject()));
}
示例9: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
/* byte version = */ in.readByte(); // version
type = in.readUTF();
subType = in.readUTF();
// allow for more data from future version
int extra = in.readShort();
if (extra > 0) {
byte[] extraBytes = new byte[extra];
in.read(extraBytes, 0, extra);
}
}
示例10: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(final ObjectInput arg0)
throws IOException, ClassNotFoundException {
// call super method
super.readExternal(arg0);
// read labels
m_labels = new String[arg0.readInt()];
for (int l = 0; l < m_labels.length; l++) {
m_labels[l] = arg0.readUTF();
}
}
示例11: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.expr = in.readUTF();
String type = in.readUTF();
if (!"".equals(type)) {
this.expectedType = ReflectionUtil.forName(type);
}
this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
.readObject()));
this.fnMapper = (FunctionMapper) in.readObject();
this.varMapper = (VariableMapper) in.readObject();
}
示例12: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
this.mark = in.readUTF();
this.target = (ValueExpression) in.readObject();
}
示例13: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
/**
* We read back the data to create a new ATAV. The structure
* read is exposed in the {@link Ava#writeExternal(ObjectOutput)}
* method
*
* @see Externalizable#readExternal(ObjectInput)
*
* @throws IOException If the Ava can't b written to the stream
* @throws ClassNotFoundException If we can't deserialize an Ava from the stream
*/
@Override
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
boolean hasUpName = in.readBoolean();
if ( hasUpName )
{
upName = in.readUTF();
}
boolean hasUpType = in.readBoolean();
if ( hasUpType )
{
upType = in.readUTF();
}
boolean hasNormType = in.readBoolean();
if ( hasNormType )
{
normType = in.readUTF();
}
if ( schemaManager != null )
{
if ( !Strings.isEmpty( upType ) )
{
attributeType = schemaManager.getAttributeType( upType );
}
else
{
attributeType = schemaManager.getAttributeType( normType );
}
}
in.readBoolean();
value = Value.deserialize( attributeType, in );
h = in.readInt();
}
示例14: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
/**
* We read back the data to create a new RDB. The structure
* read is exposed in the {@link Rdn#writeExternal(ObjectOutput)}
* method
*
* @see Externalizable#readExternal(ObjectInput)
* @param in The input stream from which the Rdn will be read
* @throws IOException If we can't read from the input stream
* @throws ClassNotFoundException If we can't create a new Rdn
*/
@Override
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
StringBuilder sb = new StringBuilder();
// Read the Ava number
nbAvas = in.readInt();
// Read the UPName
upName = in.readUTF();
switch ( nbAvas )
{
case 0:
ava = null;
normName = "";
break;
case 1:
ava = new Ava( schemaManager );
ava.readExternal( in );
avaType = ava.getNormType();
buildNormRdn( sb, ava );
normName = sb.toString();
break;
default:
avas = new ArrayList<>();
avaTypes = new HashMap<>();
boolean isFirst = true;
for ( int i = 0; i < nbAvas; i++ )
{
Ava newAva = new Ava( schemaManager );
newAva.readExternal( in );
avas.add( newAva );
List<Ava> avaList = avaTypes.get( newAva.getNormType() );
if ( avaList == null )
{
avaList = new ArrayList<>();
avaTypes.put( newAva.getNormType(), avaList );
}
if ( isFirst )
{
isFirst = false;
}
else
{
sb.append( '+' );
}
buildNormRdn( sb, newAva );
avaList.add( newAva );
}
ava = null;
avaType = null;
normName = sb.toString();
break;
}
h = in.readInt();
}
示例15: readExternal
import java.io.ObjectInput; //导入方法依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.mark = in.readUTF();
this.target = (MethodExpression) in.readObject();
}