Java Code Examples for io.protostuff.Output#writeBool()

The following examples show how to use io.protostuff.Output#writeBool() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FastIdStrategy.java    From turbo-rpc with Apache License 2.0 6 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
protected <T> HasDelegate<T> tryWriteDelegateIdTo(Output output, int fieldNumber, Class<T> clazz)
		throws IOException {
	final String className = clazz.getName();

	final HasDelegate<T> hd = (HasDelegate<T>) delegateMapping.get(className);

	if (hd == null) {
		return null;
	}

	final Integer pojoID = nameToPojoIDMap.get(className);
	if (pojoID != null) {
		output.writeBool(fieldNumber, true, false);
		((ByteBufOutput) output).writeRawInt32(pojoID);
	} else {
		output.writeBool(fieldNumber, false, false);
		((ByteBufOutput) output).writeRawString(className);
	}

	return hd;
}
 
Example 2
Source File: FastIdStrategy.java    From turbo-rpc with Apache License 2.0 6 votes vote down vote up
@Override
protected <T> HasSchema<T> tryWritePojoIdTo(Output output, int fieldNumber, Class<T> clazz, boolean registered)
		throws IOException {
	HasSchema<T> hs = getSchemaWrapper(clazz, false);

	if (hs == null || (registered && hs instanceof Lazy<?>))
		return null;

	final String className = clazz.getName();
	final Integer pojoID = nameToPojoIDMap.get(className);

	if (pojoID != null) {
		output.writeBool(fieldNumber, true, false);
		((ByteBufOutput) output).writeRawInt32(pojoID);
	} else {
		output.writeBool(fieldNumber, false, false);
		((ByteBufOutput) output).writeRawString(className);
	}

	return hs;
}
 
Example 3
Source File: EdgeSummaryQueryMessage.java    From datawave with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(Output output, EdgeSummaryQueryMessage message) throws IOException {
    output.writeBool(1, message.scanLimitHit, false);
    output.writeString(2, message.queryLogicWarning, false);
}
 
Example 4
Source File: RuntimeUnsafeFieldFactory.java    From protostuff with Apache License 2.0 4 votes vote down vote up
@Override
public void transfer(Pipe pipe, Input input, Output output, int number,
        boolean repeated) throws IOException
{
    output.writeBool(number, input.readBool(), repeated);
}
 
Example 5
Source File: RuntimeUnsafeFieldFactory.java    From protostuff with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(Output output, int number, Boolean value,
        boolean repeated) throws IOException
{
    output.writeBool(number, value.booleanValue(), repeated);
}
 
Example 6
Source File: RuntimeReflectionFieldFactory.java    From protostuff with Apache License 2.0 4 votes vote down vote up
@Override
public void transfer(Pipe pipe, Input input, Output output, int number,
        boolean repeated) throws IOException
{
    output.writeBool(number, input.readBool(), repeated);
}
 
Example 7
Source File: RuntimeReflectionFieldFactory.java    From protostuff with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(Output output, int number, Boolean value,
        boolean repeated) throws IOException
{
    output.writeBool(number, value.booleanValue(), repeated);
}