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

The following examples show how to use io.protostuff.Output#writeInt64() . 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: ProtostuffCodecTest.java    From c5-replicator with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(Output output, SerObj message) throws IOException {
  output.writeInt32(1, message.id, false);
  output.writeString(2, message.desc, false);
  output.writeInt64(3, message.timestamp, false);
  output.writeDouble(4, message.cost, false);
}
 
Example 2
Source File: AbstractSqlDateSchema.java    From joyrpc with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(final Output output, final T message) throws IOException {
    output.writeInt64(1, message.getTime(), false);
}
 
Example 3
Source File: InstantSchema.java    From joyrpc with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(final Output output, final Instant message) throws IOException {
    output.writeInt64(1, message.getEpochSecond(), false);
    output.writeInt32(2, message.getNano(), false);
}
 
Example 4
Source File: DurationSchema.java    From joyrpc with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(final Output output, final Duration message) throws IOException {
    output.writeInt64(1, message.getSeconds(), false);
    output.writeInt32(2, message.getNano(), false);
}
 
Example 5
Source File: QueryImpl.java    From datawave with Apache License 2.0 4 votes vote down vote up
public void writeTo(Output output, QueryImpl message) throws IOException {
    if (message.queryLogicName == null)
        throw new UninitializedMessageException(message, SCHEMA);
    output.writeString(1, message.queryLogicName, false);
    
    if (message.id == null)
        throw new UninitializedMessageException(message, SCHEMA);
    output.writeString(2, message.id, false);
    
    if (message.queryName != null)
        output.writeString(3, message.queryName, false);
    
    if (message.userDN == null)
        throw new UninitializedMessageException(message, SCHEMA);
    output.writeString(4, message.userDN, false);
    
    if (message.query == null)
        throw new UninitializedMessageException(message, SCHEMA);
    output.writeString(5, message.query, false);
    
    if (message.beginDate != null)
        output.writeInt64(6, message.beginDate.getTime(), false);
    
    if (message.endDate != null)
        output.writeInt64(7, message.endDate.getTime(), false);
    
    if (message.queryAuthorizations == null)
        throw new UninitializedMessageException(message, SCHEMA);
    output.writeString(8, message.queryAuthorizations, false);
    
    if (message.expirationDate == null)
        throw new UninitializedMessageException(message, SCHEMA);
    output.writeInt64(9, message.expirationDate.getTime(), false);
    
    if (message.pagesize <= 0)
        throw new UninitializedMessageException(message, SCHEMA);
    output.writeUInt32(10, message.pagesize, false);
    
    if (message.parameters != null) {
        for (Parameter p : message.parameters) {
            output.writeObject(11, p, Parameter.SCHEMA, true);
        }
    }
    
    if (message.owner == null)
        throw new UninitializedMessageException(message, SCHEMA);
    output.writeString(12, message.owner, false);
    
    if (null != message.dnList) {
        for (String dn : message.dnList)
            output.writeString(13, dn, true);
    }
    
    if (message.columnVisibility != null) {
        output.writeString(14, message.columnVisibility, false);
    }
    
    if (message.pageTimeout == 0)
        throw new UninitializedMessageException(message, SCHEMA);
    output.writeUInt32(15, message.pageTimeout, false);
}
 
Example 6
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.writeInt64(number, input.readInt64(), repeated);
}
 
Example 7
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, Long value,
        boolean repeated) throws IOException
{
    output.writeInt64(number, value.longValue(), repeated);
}
 
Example 8
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.writeInt64(number, input.readInt64(), repeated);
}
 
Example 9
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, Long value,
        boolean repeated) throws IOException
{
    output.writeInt64(number, value.longValue(), repeated);
}