Package com.google.protobuf

Examples of com.google.protobuf.ByteString.toByteArray()


      RollWALWriterResponse response = admin.rollWALWriter(null, request);
      int regionCount = response.getRegionToFlushCount();
      byte[][] regionsToFlush = new byte[regionCount][];
      for (int i = 0; i < regionCount; i++) {
        ByteString region = response.getRegionToFlush(i);
        regionsToFlush[i] = region.toByteArray();
      }
      return regionsToFlush;
    } catch (ServiceException se) {
      throw ProtobufUtil.getRemoteException(se);
    }
View Full Code Here


          StoreIOException.Reason.SERIALIZATION_ERROR, ex);
    }
   
    // Insert/update key in database table
    try {
      stmt.setBytes(2, bytes.toByteArray());
      stmt.executeUpdate();
    } catch (SQLException ex) {
      throw new StoreIOException(StoreIOException.Reason.WRITE_ERROR, ex);
    }   
  }
View Full Code Here

   
    assertNotSame(input, encrypted);
    assertEquals(input, decrypted);
   
    assertFalse(same(buff, encrypted.toByteArray()));
    assertTrue(same(buff, decrypted.toByteArray()));
  }

  private boolean same(byte[] a, byte[] b) {
    if (a.length != b.length) return false;
    boolean same = true;
View Full Code Here

            out[i] = new RiakObject(vclock, bucket, key, resp.getContent(i));
        }

        boolean unchanged = resp.getUnchanged();

        return new FetchResponse(out, unchanged, vclock.toByteArray());
  }

  // /////////////////////

  public ByteString[] store(RiakObject[] values, RequestMeta meta)
View Full Code Here

    for (SenseiProtos.ByteArrayParams param : protoFacetHandlerInitializerParam.getByteParamList()) {
      ByteString value = null;
      if (!param.getIsNull()) {
        value = param.getValue();
      }
      facetHandlerInitializerParam.putByteArrayParam(param.getKey(), value.toByteArray());
    }

    return facetHandlerInitializerParam;
  }
}
View Full Code Here

  {
    try
    {
      String classname = req.getClassname();
      ByteString value = req.getVal();
      byte[] raw = value.toByteArray();
      ByteArrayInputStream bais = new ByteArrayInputStream(raw);
      ObjectInputStream ois = new ObjectInputStream(bais);
      SenseiGenericRequest ret = new SenseiGenericRequest();
      ret.setClassname(classname);
      ret.setRequest((Serializable) ois.readObject());
View Full Code Here

  {
    try
    {
      String classname = req.getClassname();
      ByteString value = req.getVal();
      byte[] raw = value.toByteArray();
      ByteArrayInputStream bais = new ByteArrayInputStream(raw);
      ObjectInputStream ois = new ObjectInputStream(bais);
      SenseiGenericResult ret = new SenseiGenericResult();
      ret.setClassname(classname);
      ret.setResult((Serializable) ois.readObject());
View Full Code Here

  public static SenseiRequest convert(SenseiSysRequestBPO.SysRequest req)
  {
    try
    {
      ByteString value = req.getVal();
      byte[] raw = value.toByteArray();
      ByteArrayInputStream bais = new ByteArrayInputStream(raw);
      ObjectInputStream ois = new ObjectInputStream(bais);
      SenseiRequest ret = (SenseiRequest) ois.readObject();
      return ret;
    } catch (Exception e)
View Full Code Here

  public static SenseiSystemInfo convert(SenseiSysResultBPO.SysResult res)
  {
    try
    {
      ByteString value = res.getVal();
      byte[] raw = value.toByteArray();
      ByteArrayInputStream bais = new ByteArrayInputStream(raw);
      ObjectInputStream ois = new ObjectInputStream(bais);
      SenseiSystemInfo ret = (SenseiSystemInfo) ois.readObject();
      return ret;
    } catch (Exception e)
View Full Code Here

  public static SenseiRequest convert(SenseiRequestBPO.Request req)
  {
    try
    {
      ByteString value = req.getVal();
      byte[] raw = value.toByteArray();
      ByteArrayInputStream bais = new ByteArrayInputStream(raw);
      ObjectInputStream ois = new ObjectInputStream(bais);
      SenseiRequest ret = (SenseiRequest) ois.readObject();
      return ret;
    } catch (Exception e)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.