Ejemplo n.º 1
0
 /*
  * public static byte[] streamToBytes(InputStream input)
  *  // throws IOException
  * {
  *  return StreamUtils.streamToBytes(input, -1);
  * }
  */
 public static byte[] StreamToBytes(System.IO.Stream input)
 {
     return(StreamUtils.StreamToBytes(input, -1));
 }
Ejemplo n.º 2
0
 /*
  * public static byte[] streamToBytes(InputStream input, int pReadLimit)
  *  // throws IOException
  * {
  *  ByteArrayOutputStream os = new ByteArrayOutputStream(Math.min(pReadLimit, IO_BUFFER_SIZE));
  *  StreamUtils.copy(input, os, pReadLimit);
  *  return os.toByteArray();
  * }
  */
 public static byte[] StreamToBytes(System.IO.Stream input, int pReadLimit)
 {
     System.IO.MemoryStream mem = new System.IO.MemoryStream();
     StreamUtils.Copy(input, mem, pReadLimit);
     return(mem.ToArray());
 }
Ejemplo n.º 3
0
 /*
  * public static void copy(InputStream input, OutputStream output)
  *  // throws IOException
  * {
  *  StreamUtils.copy(input, output, -1);
  * }
  */
 public static void Copy(System.IO.Stream inputStream, System.IO.Stream outputStream)
 {
     StreamUtils.Copy(inputStream, outputStream, -1);
 }