Skip to content

Commit

Permalink
Merge branch 'fix225' of github.com:jcookems/azure-sdk-for-java into …
Browse files Browse the repository at this point in the history
…codereview
  • Loading branch information
jcookems committed Mar 26, 2012
2 parents 38799cb + 37e8b0f commit d98b36c
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -22,6 +22,7 @@
import com.microsoft.windowsazure.services.blob.implementation.ISO8601DateConverter;
import com.microsoft.windowsazure.services.table.EdmValueConverter;
import com.microsoft.windowsazure.services.table.models.EdmType;
import com.sun.jersey.core.util.Base64;

public class DefaultEdmValueConterter implements EdmValueConverter {

Expand All @@ -41,6 +42,9 @@ public String serialize(String edmType, Object value) {
if (value instanceof Date) {
serializedValue = iso8601DateConverter.shortFormat((Date) value);
}
else if (value instanceof byte[]) {
serializedValue = new String(Base64.encode((byte[]) value));
}
else {
serializedValue = value.toString();
}
Expand Down Expand Up @@ -73,6 +77,9 @@ else if (EdmType.INT32.equals(edmType)) {
else if (EdmType.INT64.equals(edmType)) {
return Long.parseLong(value);
}
else if (EdmType.BINARY.equals(edmType)) {
return Base64.decode(value);
}

return value;
}
Expand Down

0 comments on commit d98b36c

Please sign in to comment.