InputStreamToArray() публичный статический Метод

public static InputStreamToArray ( Stream inp ) : byte[]
inp Stream
Результат byte[]
Пример #1
0
 /**
  * Creates a new {@link RandomAccessSource} by reading the specified file/resource into memory
  * @param filename the name of the resource to read
  * @return the newly created {@link RandomAccessSource}
  * @throws IOException if reading the underling file or stream fails
  */
 private IRandomAccessSource CreateByReadingToMemory(Stream inp) {
     try {
         return new ArrayRandomAccessSource(StreamUtil.InputStreamToArray(inp));
     }
     finally {
         try {inp.Close();}catch{}
     }
 }
Пример #2
0
 /**
  * Creates a {@link RandomAccessSource} based on an {@link InputStream}.  The full content of the InputStream is read into memory and used
  * as the source for the {@link RandomAccessSource}
  * @param is the stream to read from
  * @return the newly created {@link RandomAccessSource}
  */
 public IRandomAccessSource CreateSource(Stream inp) {
    try {
         return CreateSource(StreamUtil.InputStreamToArray(inp));
     }
     finally {
         try {inp.Close();}catch{}
     }       
 }