congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
StreamUtils.copy
Code IndexAdd Tabnine to your IDE (free)

How to use
copy
method
in
org.hibernate.engine.jdbc.StreamUtils

Best Java code snippets using org.hibernate.engine.jdbc.StreamUtils.copy (Showing top 15 results out of 315)

origin: hibernate/hibernate-orm

/**
 * Copy the inputStream to the outputStream.  Uses a buffer of the default size ({@link #DEFAULT_CHUNK_SIZE}).
 *
 * @param inputStream The input stream to read
 * @param outputStream The output stream to write to
 *
 * @return The number of bytes read
 *
 * @throws IOException If a problem occurred accessing either stream
 */
public static long copy(InputStream inputStream, OutputStream outputStream) throws IOException {
  return copy( inputStream, outputStream, DEFAULT_CHUNK_SIZE );
}
origin: hibernate/hibernate-orm

/**
 * Copy the reader to the writer.  Uses a buffer of the default size ({@link #DEFAULT_CHUNK_SIZE}).
 *
 * @param reader The reader to read from
 * @param writer The writer to write to
 *
 * @return The number of bytes read
 *
 * @throws IOException If a problem occurred accessing reader or writer
 */
public static long copy(Reader reader, Writer writer) throws IOException {
  return copy( reader, writer, DEFAULT_CHUNK_SIZE );
}
origin: org.hibernate.orm/hibernate-core

/**
 * Copy the inputStream to the outputStream.  Uses a buffer of the default size ({@link #DEFAULT_CHUNK_SIZE}).
 *
 * @param inputStream The input stream to read
 * @param outputStream The output stream to write to
 *
 * @return The number of bytes read
 *
 * @throws IOException If a problem occurred accessing either stream
 */
public static long copy(InputStream inputStream, OutputStream outputStream) throws IOException {
  return copy( inputStream, outputStream, DEFAULT_CHUNK_SIZE );
}
origin: org.hibernate/com.springsource.org.hibernate

public static long copy(Reader reader, Writer writer) throws IOException {
  return copy( reader, writer, DEFAULT_CHUNK_SIZE );
}
origin: org.hibernate.orm/hibernate-core

/**
 * Copy the reader to the writer.  Uses a buffer of the default size ({@link #DEFAULT_CHUNK_SIZE}).
 *
 * @param reader The reader to read from
 * @param writer The writer to write to
 *
 * @return The number of bytes read
 *
 * @throws IOException If a problem occurred accessing reader or writer
 */
public static long copy(Reader reader, Writer writer) throws IOException {
  return copy( reader, writer, DEFAULT_CHUNK_SIZE );
}
origin: org.hibernate/com.springsource.org.hibernate.core

public static long copy(InputStream inputStream, OutputStream outputStream) throws IOException {
  return copy( inputStream, outputStream, DEFAULT_CHUNK_SIZE );
}
origin: org.hibernate/com.springsource.org.hibernate

public static long copy(InputStream inputStream, OutputStream outputStream) throws IOException {
  return copy( inputStream, outputStream, DEFAULT_CHUNK_SIZE );
}
origin: org.hibernate/com.springsource.org.hibernate.core

public static long copy(Reader reader, Writer writer) throws IOException {
  return copy( reader, writer, DEFAULT_CHUNK_SIZE );
}
origin: org.beangle.commons/beangle-commons-orm

public Blob createBlob(InputStream inputStream) {
 try {
  ByteArrayOutputStream buffer = new ByteArrayOutputStream(inputStream.available());
  StreamUtils.copy(inputStream, buffer);
  return Hibernate.getLobCreator(getSession()).createBlob(buffer.toByteArray());
 } catch (Exception e) {
  throw new RuntimeException(e);
 }
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * {@inheritDoc}
 */
public Blob createBlob(InputStream inputStream, long length) {
  try {
    Blob blob = createBlob();
    OutputStream byteStream = blob.setBinaryStream( 1 );
    StreamUtils.copy( inputStream, byteStream );
    byteStream.flush();
    byteStream.close();
    // todo : validate length written versus length given?
    return blob;
  }
  catch ( SQLException e ) {
    throw new JDBCException( "Unable to prepare BLOB binary stream for writing",e );
  }
  catch ( IOException e ) {
    throw new HibernateException( "Unable to write stream contents to BLOB", e );
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * {@inheritDoc}
 */
public Clob createClob(Reader reader, long length) {
  try {
    Clob clob = createClob();
    Writer writer = clob.setCharacterStream( 1 );
    StreamUtils.copy( reader, writer );
    writer.flush();
    writer.close();
    return clob;
  }
  catch ( SQLException e ) {
    throw new JDBCException( "Unable to prepare CLOB stream for writing", e );
  }
  catch ( IOException e ) {
    throw new HibernateException( "Unable to write CLOB stream content", e );
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * {@inheritDoc}
 */
public Clob createClob(Reader reader, long length) {
  try {
    Clob clob = createClob();
    Writer writer = clob.setCharacterStream( 1 );
    StreamUtils.copy( reader, writer );
    writer.flush();
    writer.close();
    return clob;
  }
  catch ( SQLException e ) {
    throw new JDBCException( "Unable to prepare CLOB stream for writing", e );
  }
  catch ( IOException e ) {
    throw new HibernateException( "Unable to write CLOB stream content", e );
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * {@inheritDoc}
 */
public NClob createNClob(Reader reader, long length) {
  try {
    NClob nclob = createNClob();
    Writer writer = nclob.setCharacterStream( 1 );
    StreamUtils.copy( reader, writer );
    writer.flush();
    writer.close();
    return nclob;
  }
  catch ( SQLException e ) {
    throw new JDBCException( "Unable to prepare NCLOB stream for writing", e );
  }
  catch ( IOException e ) {
    throw new HibernateException( "Unable to write NCLOB stream content", e );
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * {@inheritDoc}
 */
public NClob createNClob(Reader reader, long length) {
  try {
    NClob nclob = createNClob();
    Writer writer = nclob.setCharacterStream( 1 );
    StreamUtils.copy( reader, writer );
    writer.flush();
    writer.close();
    return nclob;
  }
  catch ( SQLException e ) {
    throw new JDBCException( "Unable to prepare NCLOB stream for writing", e );
  }
  catch ( IOException e ) {
    throw new HibernateException( "Unable to write NCLOB stream content", e );
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * {@inheritDoc}
 */
public Blob createBlob(InputStream inputStream, long length) {
  try {
    Blob blob = createBlob();
    OutputStream byteStream = blob.setBinaryStream( 1 );
    StreamUtils.copy( inputStream, byteStream );
    byteStream.flush();
    byteStream.close();
    // todo : validate length written versus length given?
    return blob;
  }
  catch ( SQLException e ) {
    throw new JDBCException( "Unable to prepare BLOB binary stream for writing",e );
  }
  catch ( IOException e ) {
    throw new HibernateException( "Unable to write stream contents to BLOB", e );
  }
}
org.hibernate.engine.jdbcStreamUtilscopy

Javadoc

Copy the inputStream to the outputStream. Uses a buffer of the default size ( #DEFAULT_CHUNK_SIZE).

Popular methods of StreamUtils

    Popular in Java

    • Making http requests using okhttp
    • addToBackStack (FragmentTransaction)
    • findViewById (Activity)
    • getApplicationContext (Context)
    • InputStreamReader (java.io)
      A class for turning a byte stream into a character stream. Data read from the source input stream is
    • InetAddress (java.net)
      An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
    • Socket (java.net)
      Provides a client-side TCP socket.
    • Stream (java.util.stream)
      A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
    • Base64 (org.apache.commons.codec.binary)
      Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
    • SAXParseException (org.xml.sax)
      Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
    • From CI to AI: The AI layer in your organization
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now