apache/dubbo-go-hessian2

can't decode null java date

wongoo opened this issue · 6 comments

What happened:
link to: apache/dubbo-go#105

What you expected to happen:
enable to decode null java date object

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

i will try it.

@aliiohs first u must ensure what's the encode result of null java date in java, then encode it to a zero go date, eg var _zeroDate time.Time. pls let me know for any question.

I will have a try

/**java

/**
 * Writes a null value to the stream.
 * The null will be written with the following syntax
 * <p>
 * <code><pre>
 * N
 * </pre></code>
 *
 * @param value the string value to write.
 */
@Override
public void writeNull()
        throws IOException {
    os.write('N');
}

**/

when a field is null , the write stream is N

/**java

/**
 * Reads an arbitrary object from the input stream when the type
 * is unknown.
 */
public Object readObject(List<Class<?>> expectedTypes)
        throws IOException {
    int tag = read();

    switch (tag) {
        case 'N':
            return null;

*/

when a stream is N, then get null in java

then encode it to a zero go date

What is zero go date, how to produce it ? @wongoo

@lovepoem a definition without assigment of time.Time is a zero go date , eg var _zeroDate time.Time