@SuppressWarnings("unchecked") public static StoreContext fromSerializedBytes(byte bytes[]){
  StoreContext ctx;
  if (bytes != null && bytes.length > 0) {
    ByteBuffer bb=ByteBufferSupport.fillBuffer(bytes);
    ByteBuffer frameworkId=ByteBufferSupport.createBuffer(bb);
    List<ByteBuffer> taskIds=ByteBufferSupport.createBufferList(bb,bb.getInt());
    List<ByteBuffer> taskNodes=ByteBufferSupport.createBufferList(bb,bb.getInt());
    List<ByteBuffer> pendingTasks=ByteBufferSupport.createBufferList(bb,bb.getInt());
    List<ByteBuffer> stagingTasks=ByteBufferSupport.createBufferList(bb,bb.getInt());
    List<ByteBuffer> activeTasks=ByteBufferSupport.createBufferList(bb,bb.getInt());
    List<ByteBuffer> lostTasks=ByteBufferSupport.createBufferList(bb,bb.getInt());
    List<ByteBuffer> killableTasks=ByteBufferSupport.createBufferList(bb,bb.getInt());
    ctx=new StoreContext(frameworkId,taskIds,taskNodes,pendingTasks,stagingTasks,activeTasks,lostTasks,killableTasks);
  }
 else {
    ctx=new StoreContext();
  }
  return ctx;
}

@ SuppressWarnings ( "unchecked" ) public static StoreContext fromSerializedBytes ( byte bytes [ ] ) { StoreContext ctx ; if ( bytes != null && bytes . length > 0 ) { ByteBuffer bb = ByteBufferSupport . fillBuffer ( bytes ) ; ByteBuffer frameworkId = ByteBufferSupport . createBuffer ( bb ) ; List < ByteBuffer > taskIds = ByteBufferSupport . createBufferList ( bb , bb . getInt ( ) ) ; List < ByteBuffer > taskNodes = ByteBufferSupport . createBufferList ( bb , bb . getInt ( ) ) ; List < ByteBuffer > pendingTasks = ByteBufferSupport . createBufferList ( bb , bb . getInt ( ) ) ; List < ByteBuffer > stagingTasks = ByteBufferSupport . createBufferList ( bb , bb . getInt ( ) ) ; List < ByteBuffer > activeTasks = ByteBufferSupport . createBufferList ( bb , bb . getInt ( ) ) ; List < ByteBuffer > lostTasks = ByteBufferSupport . createBufferList ( bb , bb . getInt ( ) ) ; List < ByteBuffer > killableTasks = ByteBufferSupport . createBufferList ( bb , bb . getInt ( ) ) ; ctx = new StoreContext ( frameworkId , taskIds , taskNodes , pendingTasks , stagingTasks , activeTasks , lostTasks , killableTasks ) ; } else { ctx = new StoreContext ( ) ; } return ctx ; }
when the bytes come back from the store , use this method to create a new context .
