Skip to content

Commit

Permalink
short & byte should be INT JAVA-96
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Mar 26, 2010
1 parent 997e367 commit 263fa95
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/com/mongodb/ByteEncoder.java
Expand Up @@ -20,6 +20,7 @@

import java.util.*;
import java.util.regex.*;
import java.util.concurrent.atomic.*;
import java.nio.*;
import java.nio.charset.*;
import java.lang.reflect.Array;
Expand Down Expand Up @@ -380,11 +381,15 @@ protected int putDate( String name , Date d ){

protected int putNumber( String name , Number n ){
int start = _buf.position();
if ( n instanceof Integer ){
if ( n instanceof Integer ||
n instanceof Short ||
n instanceof Byte ||
n instanceof AtomicInteger ){
_put( NUMBER_INT , name );
_buf.putInt( n.intValue() );
}
else if (n instanceof Long ) {
else if ( n instanceof Long ||
n instanceof AtomicLong ) {
_put( NUMBER_LONG , name );
_buf.putLong( n.longValue() );
}
Expand Down

0 comments on commit 263fa95

Please sign in to comment.