org.apache.commons.net.io.Util.copyStream()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(250)

本文整理了Java中org.apache.commons.net.io.Util.copyStream()方法的一些代码示例,展示了Util.copyStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.copyStream()方法的具体详情如下:
包路径:org.apache.commons.net.io.Util
类名称:Util
方法名:copyStream

Util.copyStream介绍

[英]Same as copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE);
[中]与copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE);相同

代码示例

代码示例来源:origin: commons-net/commons-net

  1. /***
  2. * Same as <code> copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE); </code>
  3. * @param source where to copy from
  4. * @param dest where to copy to
  5. * @return number of bytes copied
  6. * @throws CopyStreamException on error
  7. ***/
  8. public static final long copyStream(InputStream source, OutputStream dest)
  9. throws CopyStreamException
  10. {
  11. return copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE);
  12. }

代码示例来源:origin: commons-net/commons-net

  1. /***
  2. * Copies the contents of an InputStream to an OutputStream using a
  3. * copy buffer of a given size. The contents of the InputStream are
  4. * read until the end of the stream is reached, but neither the
  5. * source nor the destination are closed. You must do this yourself
  6. * outside of the method call. The number of bytes read/written is
  7. * returned.
  8. *
  9. * @param source The source InputStream.
  10. * @param dest The destination OutputStream.
  11. * @param bufferSize The number of bytes to buffer during the copy.
  12. * A zero or negative value means to use {@link #DEFAULT_COPY_BUFFER_SIZE}.
  13. * @return The number of bytes read/written in the copy operation.
  14. * @throws CopyStreamException If an error occurs while reading from the
  15. * source or writing to the destination. The CopyStreamException
  16. * will contain the number of bytes confirmed to have been
  17. * transferred before an
  18. * IOException occurred, and it will also contain the IOException
  19. * that caused the error. These values can be retrieved with
  20. * the CopyStreamException getTotalBytesTransferred() and
  21. * getIOException() methods.
  22. ***/
  23. public static final long copyStream(InputStream source, OutputStream dest,
  24. int bufferSize)
  25. throws CopyStreamException
  26. {
  27. return copyStream(source, dest, bufferSize,
  28. CopyStreamEvent.UNKNOWN_STREAM_SIZE, null);
  29. }

代码示例来源:origin: commons-net/commons-net

  1. throws CopyStreamException
  2. return copyStream(source, dest, bufferSize, streamSize, listener,
  3. true);

代码示例来源:origin: commons-net/commons-net

  1. Util.copyStream(local, output, getBufferSize(),
  2. CopyStreamEvent.UNKNOWN_STREAM_SIZE, __mergeListeners(csl),
  3. false);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-net

  1. /***
  2. * Same as <code> copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE); </code>
  3. ***/
  4. public static final long copyStream(InputStream source, OutputStream dest)
  5. throws CopyStreamException
  6. {
  7. return copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE);
  8. }

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.net

  1. /***
  2. * Same as <code> copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE); </code>
  3. ***/
  4. public static final long copyStream(InputStream source, OutputStream dest)
  5. throws CopyStreamException
  6. {
  7. return copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE);
  8. }

代码示例来源:origin: commons-net/commons-net

  1. Util.copyStream(input, local, getBufferSize(),
  2. CopyStreamEvent.UNKNOWN_STREAM_SIZE, __mergeListeners(csl),
  3. false);

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.net

  1. /***
  2. * Copies the contents of an InputStream to an OutputStream using a
  3. * copy buffer of a given size. The contents of the InputStream are
  4. * read until the end of the stream is reached, but neither the
  5. * source nor the destination are closed. You must do this yourself
  6. * outside of the method call. The number of bytes read/written is
  7. * returned.
  8. * <p>
  9. * @param source The source InputStream.
  10. * @param dest The destination OutputStream.
  11. * @return The number of bytes read/written in the copy operation.
  12. * @exception CopyStreamException If an error occurs while reading from the
  13. * source or writing to the destination. The CopyStreamException
  14. * will contain the number of bytes confirmed to have been
  15. * transferred before an
  16. * IOException occurred, and it will also contain the IOException
  17. * that caused the error. These values can be retrieved with
  18. * the CopyStreamException getTotalBytesTransferred() and
  19. * getIOException() methods.
  20. ***/
  21. public static final long copyStream(InputStream source, OutputStream dest,
  22. int bufferSize)
  23. throws CopyStreamException
  24. {
  25. return copyStream(source, dest, bufferSize,
  26. CopyStreamEvent.UNKNOWN_STREAM_SIZE, null);
  27. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-net

  1. /***
  2. * Copies the contents of an InputStream to an OutputStream using a
  3. * copy buffer of a given size. The contents of the InputStream are
  4. * read until the end of the stream is reached, but neither the
  5. * source nor the destination are closed. You must do this yourself
  6. * outside of the method call. The number of bytes read/written is
  7. * returned.
  8. * <p>
  9. * @param source The source InputStream.
  10. * @param dest The destination OutputStream.
  11. * @return The number of bytes read/written in the copy operation.
  12. * @exception CopyStreamException If an error occurs while reading from the
  13. * source or writing to the destination. The CopyStreamException
  14. * will contain the number of bytes confirmed to have been
  15. * transferred before an
  16. * IOException occurred, and it will also contain the IOException
  17. * that caused the error. These values can be retrieved with
  18. * the CopyStreamException getTotalBytesTransferred() and
  19. * getIOException() methods.
  20. ***/
  21. public static final long copyStream(InputStream source, OutputStream dest,
  22. int bufferSize)
  23. throws CopyStreamException
  24. {
  25. return copyStream(source, dest, bufferSize,
  26. CopyStreamEvent.UNKNOWN_STREAM_SIZE, null);
  27. }

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.net

  1. throws CopyStreamException
  2. return copyStream(source, dest, bufferSize, streamSize, listener,
  3. true);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-net

  1. throws CopyStreamException
  2. return copyStream(source, dest, bufferSize, streamSize, listener,
  3. true);

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.net

  1. Util.copyStream(local, output, getBufferSize(),
  2. CopyStreamEvent.UNKNOWN_STREAM_SIZE, null,
  3. false);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-net

  1. Util.copyStream(local, output, getBufferSize(),
  2. CopyStreamEvent.UNKNOWN_STREAM_SIZE, null,
  3. false);

代码示例来源:origin: net.seedboxer/ftp-common

  1. Util.copyStream(ins, outs, ftpClient.getBufferSize(), size, adapter);
  2. } finally {
  3. outs.close();

代码示例来源:origin: TGAC/miso-lims

  1. copyStream(fis, ops, ftp.getBufferSize(), file.length(), listener);

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.net

  1. Util.copyStream(input, local, getBufferSize(),
  2. CopyStreamEvent.UNKNOWN_STREAM_SIZE, null,
  3. false);

代码示例来源:origin: com.github.goldin/maven-common

  1. Util.copyStream(input, local, getBufferSize(),
  2. CopyStreamEvent.UNKNOWN_STREAM_SIZE, new CopyStreamListener( this.project ),
  3. false);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-net

  1. Util.copyStream(input, local, getBufferSize(),
  2. CopyStreamEvent.UNKNOWN_STREAM_SIZE, null,
  3. false);

代码示例来源:origin: net.sourceforge.openutils/openutils-mgnlmedia

  1. org.apache.commons.net.io.Util.copyStream(
  2. inputStream,
  3. os,

相关文章