Codota Logo
StreamUtils
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
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.jdbcStreamUtils

Javadoc

Stream copying utilities

Most used methods

  • copy
    Copy the reader to the writer using a buffer of the specified size

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now