本文整理了Java中io.protostuff.Input.readString()
方法的一些代码示例,展示了Input.readString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Input.readString()
方法的具体详情如下:
包路径:io.protostuff.Input
类名称:Input
方法名:readString
[英]Reads a String field value.
[中]读取字符串字段值。
代码示例来源:origin: protostuff/protostuff
@Override
public void mergeFrom(Input input, RequiresName message) throws IOException
{
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch (number)
{
case 0:
return;
case 1:
message.name = input.readString();
break;
case 2:
message.description = input.readString();
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: protostuff/protostuff
@Override
public Object readFrom(Input input, Object owner) throws IOException
{
if (ID_ARRAY_LEN != input.readFieldNumber(this))
throw new ProtostuffException("Corrupt input.");
final int len = input.readInt32();
BigDecimal[] array = new BigDecimal[len];
if (input instanceof GraphInput)
{
// update the actual reference.
((GraphInput) input).updateLast(array, owner);
}
for (int i = 0; i < len;)
{
switch (input.readFieldNumber(this))
{
case ID_ARRAY_DATA:
array[i++] = new BigDecimal(input.readString());
break;
case ID_ARRAY_NULLCOUNT:
i += input.readUInt32();
break;
default:
throw new ProtostuffException("Corrupt input.");
}
}
if (0 != input.readFieldNumber(this))
throw new ProtostuffException("Corrupt input.");
return array;
}
代码示例来源:origin: protostuff/protostuff
public void mergeFrom(Input input, SampleClass message) throws IOException
{
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch (number)
{
case 0:
return;
case 1:
if (message.testString == null)
message.testString = new ArrayList<String>();
message.testString.add(input.readString());
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: protostuff/protostuff
@Override
public Object readFrom(Input input, Object owner) throws IOException
{
if (ID_ARRAY_LEN != input.readFieldNumber(this))
throw new ProtostuffException("Corrupt input.");
final int len = input.readInt32();
BigDecimal[] array = new BigDecimal[len];
if (input instanceof GraphInput)
{
// update the actual reference.
((GraphInput) input).updateLast(array, owner);
}
for (int i = 0; i < len;)
{
switch (input.readFieldNumber(this))
{
case ID_ARRAY_DATA:
array[i++] = new BigDecimal(input.readString());
break;
case ID_ARRAY_NULLCOUNT:
i += input.readUInt32();
break;
default:
throw new ProtostuffException("Corrupt input.");
}
}
if (0 != input.readFieldNumber(this))
throw new ProtostuffException("Corrupt input.");
return array;
}
代码示例来源:origin: protostuff/protostuff
@Override
public void mergeFrom(Input input, HasHasBar message) throws IOException
{
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch (number)
{
case 0:
return;
case 1:
message.name = input.readString();
break;
case 2:
message.hasBar = readHasBar(input);
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: protostuff/protostuff
@Override
public Object readFrom(Input input, Object owner) throws IOException
{
if (ID_ARRAY_LEN != input.readFieldNumber(this))
throw new ProtostuffException("Corrupt input.");
final int len = input.readInt32();
String[] array = new String[len];
if (input instanceof GraphInput)
{
// update the actual reference.
((GraphInput) input).updateLast(array, owner);
}
for (int i = 0; i < len;)
{
switch (input.readFieldNumber(this))
{
case ID_ARRAY_DATA:
array[i++] = input.readString();
break;
case ID_ARRAY_NULLCOUNT:
i += input.readUInt32();
break;
default:
throw new ProtostuffException("Corrupt input.");
}
}
if (0 != input.readFieldNumber(this))
throw new ProtostuffException("Corrupt input.");
return array;
}
代码示例来源:origin: protostuff/protostuff
@Override
public void mergeFrom(Input input, Student message) throws IOException
{
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch (number)
{
case 0:
return;
case 1:
message.name = input.readString();
break;
case 2:
if (message.club == null)
message.club = new ArrayList<Club>();
message.club.add(input.mergeObject(null, Club.getSchema()));
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: protostuff/protostuff
@Override
public Object readFrom(Input input, Object owner) throws IOException
{
if (ID_ARRAY_LEN != input.readFieldNumber(this))
throw new ProtostuffException("Corrupt input.");
final int len = input.readInt32();
String[] array = new String[len];
if (input instanceof GraphInput)
{
// update the actual reference.
((GraphInput) input).updateLast(array, owner);
}
for (int i = 0; i < len;)
{
switch (input.readFieldNumber(this))
{
case ID_ARRAY_DATA:
array[i++] = input.readString();
break;
case ID_ARRAY_NULLCOUNT:
i += input.readUInt32();
break;
default:
throw new ProtostuffException("Corrupt input.");
}
}
if (0 != input.readFieldNumber(this))
throw new ProtostuffException("Corrupt input.");
return array;
}
代码示例来源:origin: protostuff/protostuff
@Override
public void mergeFrom(Input input, ClubFounder message) throws IOException
{
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch (number)
{
case 0:
return;
case 1:
message.name = input.readString();
break;
case 2:
message.club = input.mergeObject(message.club, Club.getSchema());
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: org.apache.servicecomb/foundation-protobuf
@Override
public void mergeFrom(Input input, Object message) throws IOException {
input.readFieldNumber(null);
String typeUrl = input.readString();
input.readFieldNumber(null);
byte[] bytes = input.readByteArray();
input.readFieldNumber(null);
AnyEntry anyEntry = (AnyEntry) message;
anyEntry.setTypeUrl(typeUrl);
anyEntry.setValue(bytes);
}
代码示例来源:origin: protostuff/protostuff
@Override
public void mergeFrom(Input input, Baz message) throws IOException
{
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch (number)
{
case 0:
return;
case 1:
message.id = input.readInt32();
break;
case 2:
message.name = input.readString();
break;
case 3:
message.timestamp = input.readInt64();
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: protostuff/protostuff
@Override
public void mergeFrom(Input input, Club message) throws IOException
{
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch (number)
{
case 0:
return;
case 1:
message.name = input.readString();
break;
case 2:
if (message.student == null)
message.student = new ArrayList<Student>();
message.student.add(input.mergeObject(null, Student.getSchema()));
break;
case 3:
if (message.partnerClub == null)
message.partnerClub = new ArrayList<Club>();
message.partnerClub.add(input.mergeObject(null, Club.getSchema()));
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: protostuff/protostuff
@Override
public void mergeFrom(Input input, Foo message) throws IOException
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
if (message.someString == null)
message.someString = new ArrayList<String>();
message.someString.add(input.readString());
break;
case 3:
break;
default:
input.handleUnknownField(number, this);
代码示例来源:origin: protostuff/protostuff
@Override
public void mergeFrom(Input input, Bar message) throws IOException
for (int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
break;
case 2:
message.someString = input.readString();
break;
case 3:
break;
default:
input.handleUnknownField(number, this);
代码示例来源:origin: NationalSecurityAgency/datawave
public void mergeFrom(Input input, Parameter message) throws IOException {
int number;
while ((number = input.readFieldNumber(this)) != 0) {
switch (number) {
case 1:
message.parameterName = input.readString();
break;
case 2:
message.parameterValue = input.readString();
break;
default:
input.handleUnknownField(number, this);
break;
}
}
}
代码示例来源:origin: dremio/dremio-oss
public void mergeFrom(Input input, JobId message) throws IOException
{
for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch(number)
{
case 0:
return;
case 1:
message.id = input.readString();
break;
case 2:
message.name = input.readString();
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: dremio/dremio-oss
public void mergeFrom(Input input, FromTable message) throws IOException
{
for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch(number)
{
case 0:
return;
case 1:
message.datasetPath = input.readString();
break;
case 2:
message.alias = input.readString();
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: dremio/dremio-oss
public void mergeFrom(Input input, FromSQL message) throws IOException
{
for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch(number)
{
case 0:
return;
case 1:
message.sql = input.readString();
break;
case 2:
message.alias = input.readString();
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: dremio/dremio-oss
public void mergeFrom(Input input, FailureDetails message) throws IOException
{
for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch(number)
{
case 0:
return;
case 1:
message.message = input.readString();
break;
case 2:
message.stackTrace = input.readString();
break;
default:
input.handleUnknownField(number, this);
}
}
}
代码示例来源:origin: dremio/dremio-oss
public void mergeFrom(Input input, MaterializatonFailure message) throws IOException
{
for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
{
switch(number)
{
case 0:
return;
case 1:
message.message = input.readString();
break;
case 2:
message.stackTrace = input.readString();
break;
default:
input.handleUnknownField(number, this);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!