private static SampleClass deserialize(final byte[] bytes) throws Exception
    {
        final SampleClass t = new SampleClass();
        ObjectInputStream ois = null;
        try
        {
            ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
            t.readExternal(ois);
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        finally
        {
            tryClose(ois);
        }
        return t;
    }
From https://groups.google.com/forum/#!topic/protostuff/D7Bb1REf8pQ (Anil Pandge)
protostuff-core/src/test/java/io/protostuff/CodedDataInputTest.java