/**
 * Copyright (C) 2014 Microsoft Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.microsoft.wake.remote.impl;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import com.microsoft.wake.remote.Codec;
import com.microsoft.wake.remote.exception.RemoteRuntimeException;

/**
 * Codec that uses Java serialization
 *
 * @param <T>
 */
public class ObjectSerializableCodec<T> implements Codec<T> {
  
  /**
   * Encodes the object to bytes
   * 
   * @param obj the object
   * @return bytes
   * @throws RemoteRuntimeException
   */
  @Override
  public byte[] encode(final T obj) {
    try (final ByteArrayOutputStream bos = new ByteArrayOutputStream();
         final ObjectOutputStream out = new ObjectOutputStream(bos)) {
      out.writeObject(obj);
      return bos.toByteArray();
    } catch (final IOException ex) {
      throw new RemoteRuntimeException(ex);
    }
  }

  /**
   * Decodes an object from the bytes
   * 
   * @param buf the bytes
   * @return an object
   * @throws RemoteRuntimeException
   */
  @SuppressWarnings("unchecked")
  @Override
  public T decode(final byte[] buf) {
    try (final ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buf))) {
      return (T)in.readObject();
    } catch (final ClassNotFoundException | IOException ex) {
      throw new RemoteRuntimeException(ex);
    }
  }
}

@@ -821,16 +821,45 @@
 tream;%0A%0A
+import javax.inject.Inject;%0A%0A
 import c
@@ -1219,16 +1219,78 @@
 n%0A   */%0A
+  %0A  @Inject%0A  public ObjectSerializableCodec() %7B%0A    %0A  %7D%0A  %0A
   @Overr

Add Injectable constructor to ObjectSerializableCodec