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

The following examples show how to use io.protostuff.Output#writeFixed64() . 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: ArraySchemas.java    From protostuff with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(Output output, Object value) throws IOException
{
    Date[] array = (Date[]) value;
    output.writeInt32(ID_ARRAY_LEN, array.length, false);

    int nullCount = 0;
    for (int i = 0, len = array.length; i < len; i++)
    {
        Date v = array[i];
        if (v != null)
        {
            if (nullCount != 0)
            {
                output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false);
                nullCount = 0;
            }

            output.writeFixed64(ID_ARRAY_DATA, v.getTime(), true);
        }
        else if (allowNullArrayElement)
        {
            nullCount++;
        }
    }

    // if last element is null
    if (nullCount != 0)
        output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false);
}
 
Example 2
Source File: TimeDelegate.java    From joyrpc with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(Output output, int number, Time time, boolean repeated) throws IOException {
    output.writeFixed64(number, time.getTime(), repeated);
}
 
Example 3
Source File: TimeDelegate.java    From joyrpc 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.writeFixed64(number, input.readFixed64(), repeated);
}
 
Example 4
Source File: SqlDateDelegate.java    From joyrpc with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(Output output, int number, java.sql.Date value, boolean repeated) throws IOException {
    output.writeFixed64(number, value.getTime(), repeated);
}
 
Example 5
Source File: SqlDateDelegate.java    From joyrpc 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.writeFixed64(number, input.readFixed64(), repeated);
}
 
Example 6
Source File: TimestampDelegate.java    From joyrpc with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(Output output, int number, Timestamp value, boolean repeated) throws IOException {
    output.writeFixed64(number, value.getTime(), repeated);
}
 
Example 7
Source File: TimestampDelegate.java    From joyrpc 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.writeFixed64(number, input.readFixed64(), repeated);
}
 
Example 8
Source File: DateDelegate.java    From tx-lcn with Apache License 2.0 4 votes vote down vote up
public void writeTo(Output output, int number, Date value,
                    boolean repeated) throws IOException {
    output.writeFixed64(number, value.getTime(), repeated);
}
 
Example 9
Source File: DateDelegate.java    From tx-lcn with Apache License 2.0 4 votes vote down vote up
public void transfer(Pipe pipe, Input input, Output output, int number,
                     boolean repeated) throws IOException {
    output.writeFixed64(number, input.readFixed64(), repeated);
}
 
Example 10
Source File: TimestampDelegate.java    From tx-lcn with Apache License 2.0 4 votes vote down vote up
public void writeTo(Output output, int number, Timestamp value,
                    boolean repeated) throws IOException {
    output.writeFixed64(number, value.getTime(), repeated);
}
 
Example 11
Source File: TimestampDelegate.java    From tx-lcn with Apache License 2.0 4 votes vote down vote up
public void transfer(Pipe pipe, Input input, Output output, int number,
                     boolean repeated) throws IOException {
    output.writeFixed64(number, input.readFixed64(), repeated);
}
 
Example 12
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.writeFixed64(number, input.readFixed64(), repeated);
}
 
Example 13
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, Date value,
        boolean repeated) throws IOException
{
    output.writeFixed64(number, value.getTime(), repeated);
}
 
Example 14
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.writeFixed64(number, input.readFixed64(), repeated);
}
 
Example 15
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, Date value,
        boolean repeated) throws IOException
{
    output.writeFixed64(number, value.getTime(), repeated);
}