Examples of toByteArray()


Examples of com.fasterxml.uuid.EthernetAddress.toByteArray()

       
        // first we'll test the null EthernetAddress
        EthernetAddress ethernet_address = new EthernetAddress(0L);
        assertEquals("Expected length of returned array wrong",
            ETHERNET_ADDRESS_ARRAY_LENGTH,
            ethernet_address.toByteArray().length);
        assertEthernetAddressArraysAreEqual(
            NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0,
            ethernet_address.toByteArray(), 0);
       
        // now test a non-null EthernetAddress
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash.toByteArray()

      throw new IllegalArgumentException();
    }

    X509Certificate certificate = certificateChain[0];
    Md5Hash signature = OpenSshUtils.getSignature(certificate.getPublicKey());
    final byte[] signatureBytes = signature.toByteArray();

    SecretStoreDecoder visitor = new SecretStoreDecoder() {
      @Override
      public void visitGenericAsymetricKey(byte[] publicKeySignature, byte[] data) {
        if (Arrays.equals(publicKeySignature, signatureBytes)) {
View Full Code Here

Examples of com.google.appengine.api.blobstore.BlobstoreServicePb.CreateEncodedGoogleStorageKeyRequest.toByteArray()

    request.setFilename(filename);

    byte[] responseBytes;
    try {
      responseBytes = ApiProxy.makeSyncCall(PACKAGE,
          "CreateEncodedGoogleStorageKey", request.toByteArray());
    } catch (ApiProxy.ApplicationException ex) {
      switch (BlobstoreServiceError.ErrorCode.valueOf(ex.getApplicationError())) {
        case INTERNAL_ERROR:
          throw new BlobstoreFailureException("An internal blobstore error occured.");
        default:
View Full Code Here

Examples of com.google.appengine.api.blobstore.BlobstoreServicePb.CreateUploadURLRequest.toByteArray()

      request.setGsBucketName(uploadOptions.getGoogleStorageBucketName());
    }

    byte[] responseBytes;
    try {
      responseBytes = ApiProxy.makeSyncCall(PACKAGE, "CreateUploadURL", request.toByteArray());
    } catch (ApiProxy.ApplicationException ex) {
      switch (BlobstoreServiceError.ErrorCode.valueOf(ex.getApplicationError())) {
        case URL_TOO_LONG:
          throw new IllegalArgumentException("The resulting URL was too long.");
        case INTERNAL_ERROR:
View Full Code Here

Examples of com.google.appengine.api.blobstore.BlobstoreServicePb.DeleteBlobRequest.toByteArray()

      return;
    }

    byte[] responseBytes;
    try {
      responseBytes = ApiProxy.makeSyncCall(PACKAGE, "DeleteBlob", request.toByteArray());
    } catch (ApiProxy.ApplicationException ex) {
      switch (BlobstoreServiceError.ErrorCode.valueOf(ex.getApplicationError())) {
        case INTERNAL_ERROR:
          throw new BlobstoreFailureException("An internal blobstore error occured.");
        default:
View Full Code Here

Examples of com.google.appengine.api.blobstore.BlobstoreServicePb.FetchDataRequest.toByteArray()

    request.setStartIndex(startIndex);
    request.setEndIndex(endIndex);

    byte[] responseBytes;
    try {
      responseBytes = ApiProxy.makeSyncCall(PACKAGE, "FetchData", request.toByteArray());
    } catch (ApiProxy.ApplicationException ex) {
      switch (BlobstoreServiceError.ErrorCode.valueOf(ex.getApplicationError())) {
        case PERMISSION_DENIED:
          throw new SecurityException("This application does not have access to that blob.");
        case BLOB_NOT_FOUND:
View Full Code Here

Examples of com.google.appengine.api.conversion.ConversionServicePb.ConversionRequest.toByteArray()

                   + "and all calls to it will return an error.");
    final ConversionRequest request =
        conversionRequestProtoConverter.convert(Arrays.asList(conversion));

    Future<byte[]> responseBytes = ApiProxy.makeAsyncCall(
        CONVERSION_SERVICE, CONVERT_METHOD, request.toByteArray(), createApiConfig(deadline));
    return new ConversionFutureWrapper<byte[], ConversionResult>(responseBytes) {
      @Override
      protected ConversionResult wrap(byte[] responseBytes) throws IOException {
        ConversionResponse.Builder response = ConversionResponse.newBuilder()
            .mergeFrom(responseBytes);
View Full Code Here

Examples of com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueBulkAddResponse.toByteArray()

            for (int i = 0; i < taskPb.addRequestSize(); i++) {
                tasks.add(taskPb.getAddRequest(i));
                responsePb.addTaskResult().setChosenTaskName(
                    "task" + String.valueOf(System.nanoTime()));
            }
            return responsePb.toByteArray();
        } else if (MEMCACHE_SERVICE.equals(service)) {
            if (SET_METHOD.equals(method)) {
                try {
                    MemcacheSetRequest.Builder builder =
                        MemcacheSetRequest.newBuilder().mergeFrom(requestBuf);
View Full Code Here

Examples of com.google.appengine.api.xmpp.XMPPServicePb.BulkPresenceRequest.toByteArray()

      request.setFromJid(fromJid.getId());
    }

    byte[] responseBytes;
    try {
      responseBytes = ApiProxy.makeSyncCall(PACKAGE, "BulkGetPresence", request.toByteArray());
    } catch (ApiProxy.ApplicationException ex) {
      switch (XmppServiceError.ErrorCode.valueOf(ex.getApplicationError())) {
        case INVALID_JID:
          throw new IllegalArgumentException(
              "One or more jabber ID is invalid: " + jabberIds.toString());
View Full Code Here

Examples of com.google.appengine.api.xmpp.XMPPServicePb.PresenceRequest.toByteArray()

      request.setFromJid(fromJid.getId());
    }

    byte[] responseBytes;
    try {
      responseBytes = ApiProxy.makeSyncCall(PACKAGE, "GetPresence", request.toByteArray());
    } catch (ApiProxy.ApplicationException ex) {
      switch (XmppServiceError.ErrorCode.valueOf(ex.getApplicationError())) {
        case INVALID_JID:
          throw new IllegalArgumentException("Invalid jabber ID: " + jabberId);
        case NO_BODY:
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.