Code example for ByteBuffer

Methods: get, limit

0
   */ 
  public static Checkpoint getCheckpointFromEvent(DbusEvent event)
  { 
    assert (event.isCheckpointMessage());
    ByteBuffer valueBuffer = event.value();
    byte[] valueBytes = new byte[valueBuffer.limit()];
    valueBuffer.get(valueBytes);
    try 
    { 
      Checkpoint newCheckpoint = new Checkpoint(new String(valueBytes));
      return newCheckpoint;
    } 
    catch (JsonParseException e)
    { 
      throw new RuntimeException(e);
    } 
    catch (JsonMappingException e)
    { 
      throw new RuntimeException(e);
    } 
    catch (IOException e)