Examples of BlobImpl


Examples of org.hibernate.lob.BlobImpl

   * @param stream a binary stream
   * @param length the number of bytes in the stream
   * @return the Blob
   */
  public static Blob createBlob(InputStream stream, int length) {
    return new SerializableBlob( new BlobImpl( stream, length ) );
  }
View Full Code Here

Examples of org.hibernate.lob.BlobImpl

   * @param stream a binary stream
   * @return the Blob
   * @throws IOException
   */
  public static Blob createBlob(InputStream stream) throws IOException {
    return new SerializableBlob( new BlobImpl( stream, stream.available() ) );
  }
View Full Code Here

Examples of org.hibernate.lob.BlobImpl

      toSet = toBytes( value );
      if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
    else {
      st.setNull( index, sqlTypes( null )[0] );
    }
View Full Code Here

Examples of org.hibernate.lob.BlobImpl

      if ( useInputStream ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
  }
View Full Code Here

Examples of org.hibernate.lob.BlobImpl

      toSet = toBytes( value );
      if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
    else {
      st.setNull( index, sqlTypes( null )[0] );
    }
View Full Code Here

Examples of org.hibernate.lob.BlobImpl

      toSet = toBytes( value );
      if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) {
        st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length );
      }
      else {
        st.setBlob( index, new BlobImpl( toSet ) );
      }
    }
    else {
      st.setNull( index, sqlTypes( null )[0] );
    }
View Full Code Here

Examples of org.jclouds.blobstore.domain.internal.BlobImpl

      ObjectApi objectApi = api.objectApiInRegionForContainer(region.getId(), container);
      SwiftObject object = objectApi.get(name, toGetOptions.apply(options));
      if (object == null) {
         return null;
      }
      Blob blob = new BlobImpl(toBlobMetadata(container).apply(object));
      blob.setPayload(object.payload());
      blob.setAllHeaders(object.headers());
      return blob;
   }
View Full Code Here

Examples of org.jclouds.blobstore.domain.internal.BlobImpl

         if (pollingStrategy.get().waitForSuccess(container, jobId)) {
            MutableBlobMetadata blobMetadata = new MutableBlobMetadataImpl();
            blobMetadata.setContainer(container);
            blobMetadata.setName(key);

            Blob blob = new BlobImpl(blobMetadata);
            blob.setPayload(sync.getJobOutput(container, jobId));
            return blob;
         }
         return null;
      } catch (InterruptedException e) {
         throw new RuntimeException(e);
View Full Code Here

Examples of org.jclouds.blobstore.domain.internal.BlobImpl

      @Inject
      Provider<MutableBlobMetadata> metadataProvider;

      public Blob create(MutableBlobMetadata metadata) {
         return new BlobImpl(metadata != null ? metadata : metadataProvider.get());
      }
View Full Code Here

Examples of org.jclouds.blobstore.domain.internal.BlobImpl

      MutableBlobMetadata metadata = new MutableBlobMetadataImpl();
      MutableContentMetadata contentMetadata = new BaseMutableContentMetadata();
      contentMetadata.setContentLength(MultipartUploadStrategy.MAX_BLOCK_SIZE * 3 + oneMB);
      metadata.setName(blobName);
      metadata.setContentMetadata(contentMetadata);
      Blob blob = new BlobImpl(metadata);
      Payload payload = new StringPayload("ABCD");
      payload.setContentMetadata(contentMetadata);
      blob.setPayload(payload);

      expect(slicer.slice(payload, 0, MultipartUploadStrategy.MAX_BLOCK_SIZE)).andReturn(payload);
      expect(slicer.slice(payload, MultipartUploadStrategy.MAX_BLOCK_SIZE, MultipartUploadStrategy.MAX_BLOCK_SIZE)).andReturn(payload);
      expect(slicer.slice(payload, MultipartUploadStrategy.MAX_BLOCK_SIZE * 2, MultipartUploadStrategy.MAX_BLOCK_SIZE)).andReturn(payload);
      expect(slicer.slice(payload, MultipartUploadStrategy.MAX_BLOCK_SIZE * 3, oneMB)).andReturn(payload);
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.