Java Doc for StreamUtil.java in  » Testing » mockrunner-0.4 » com » mockrunner » util » common » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » mockrunner 0.4 » com.mockrunner.util.common 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.mockrunner.util.common.StreamUtil

StreamUtil
public class StreamUtil (Code)
Simple util class for manipulating streams




Method Summary
public static  booleancompareReaders(Reader sourceReader, Reader targetReader)
     Compares the content of the readers.
public static  booleancompareStreams(InputStream sourceStream, InputStream targetStream)
     Compares the content of the streams.
public static  ReadercopyReader(Reader sourceReader)
     Returns a copy of the specified reader.
public static  InputStreamcopyStream(InputStream sourceStream)
     Returns a copy of the specified stream.
public static  ListgetLinesFromReader(Reader reader)
     Reads the lines from the specified reader and adds them to a List.
public static  StringgetReaderAsString(Reader reader)
     Returns the contents of the reader as a string.
public static  StringgetReaderAsString(Reader reader, int length)
     Returns the contents of the reader as a string.
public static  byte[]getStreamAsByteArray(InputStream stream)
     Returns the contents of the input stream as byte array.
public static  byte[]getStreamAsByteArray(InputStream stream, int length)
     Returns the contents of the input stream as byte array.



Method Detail
compareReaders
public static boolean compareReaders(Reader sourceReader, Reader targetReader)(Code)
Compares the content of the readers. If the readers support marking, they will be reset after the comparison.
Parameters:
  sourceReader - the source stream
Parameters:
  targetReader - the target stream true, if the streams are identical, false otherwise



compareStreams
public static boolean compareStreams(InputStream sourceStream, InputStream targetStream)(Code)
Compares the content of the streams. If the streams support marking, they will be reset after the comparison.
Parameters:
  sourceStream - the source stream
Parameters:
  targetStream - the target stream true, if the streams are identical, false otherwise



copyReader
public static Reader copyReader(Reader sourceReader)(Code)
Returns a copy of the specified reader. If the specified reader supports marking, it will be reset after the copy.
Parameters:
  sourceReader - the stream to reader a copy of the reader



copyStream
public static InputStream copyStream(InputStream sourceStream)(Code)
Returns a copy of the specified stream. If the specified stream supports marking, it will be reset after the copy.
Parameters:
  sourceStream - the stream to copy a copy of the stream



getLinesFromReader
public static List getLinesFromReader(Reader reader)(Code)
Reads the lines from the specified reader and adds them to a List.
Parameters:
  reader - the reader the List with the lines



getReaderAsString
public static String getReaderAsString(Reader reader)(Code)
Returns the contents of the reader as a string.
Parameters:
  reader - the Reader the reader content as String



getReaderAsString
public static String getReaderAsString(Reader reader, int length)(Code)
Returns the contents of the reader as a string.
Parameters:
  reader - the Reader
Parameters:
  length - the number of chars to copy, if length < 0,the number is unlimited the reader content as String



getStreamAsByteArray
public static byte[] getStreamAsByteArray(InputStream stream)(Code)
Returns the contents of the input stream as byte array.
Parameters:
  stream - the InputStream the stream content as byte array



getStreamAsByteArray
public static byte[] getStreamAsByteArray(InputStream stream, int length)(Code)
Returns the contents of the input stream as byte array.
Parameters:
  stream - the InputStream
Parameters:
  length - the number of bytes to copy, if length < 0,the number is unlimited the stream content as byte array



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.