Java Doc for DataInputStream.java in  » Apache-Harmony-Java-SE » java-package » java » io » 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 » Apache Harmony Java SE » java package » java.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.io.InputStream
      java.io.FilterInputStream
         java.io.DataInputStream

DataInputStream
public class DataInputStream extends FilterInputStream implements DataInput(Code)
DataInputStream is a filter class which can read typed data from a Stream. Typically, this stream has been written by a DataOutputStream. Types that can be read include byte, 16-bit short, 32-bit int, 32-bit float, 64-bit long, 64-bit double, byte strings, and UTF Strings.
See Also:   DataOutputStream


Field Summary
 byte[]buff
    

Constructor Summary
public  DataInputStream(InputStream in)
     Constructs a new DataInputStream on the InputStream in. All reads can now be filtered through this stream.

Method Summary
 StringdecodeUTF(int utfSize)
    
final public  intread(byte[] buffer)
     Reads bytes from the source stream into the byte array buffer.
final public  intread(byte[] buffer, int offset, int length)
     Read at most length bytes from this DataInputStream and stores them in byte array buffer starting at offset.
final public  booleanreadBoolean()
     Reads a boolean from this stream.
final public  bytereadByte()
     Reads an 8-bit byte value from this stream.
final public  charreadChar()
    
final public  doublereadDouble()
     Reads a 64-bit double value from this stream.
final public  floatreadFloat()
     Reads a 32-bit float value from this stream.
final public  voidreadFully(byte[] buffer)
     Reads bytes from this stream into the byte array buffer.
final public  voidreadFully(byte[] buffer, int offset, int length)
     Reads bytes from this stream and stores them in the byte array buffer starting at the position offset.
final public  intreadInt()
     Reads a 32-bit integer value from this stream.
final public  StringreadLine()
     Answers a String representing the next line of text available in this BufferedReader.
final public  longreadLong()
     Reads a 64-bit long value from this stream.
final public  shortreadShort()
     Reads a 16-bit short value from this stream.
final public  StringreadUTF()
     Reads a UTF format String from this Stream.
final public static  StringreadUTF(DataInput in)
     Reads a UTF format String from the DataInput Stream in.
final public  intreadUnsignedByte()
     Reads an unsigned 8-bit byte value from this stream and returns it as an int.
final public  intreadUnsignedShort()
     Reads a 16-bit unsigned short value from this stream and returns it as an int.
final public  intskipBytes(int count)
     Skips count number of bytes in this stream.

Field Detail
buff
byte[] buff(Code)




Constructor Detail
DataInputStream
public DataInputStream(InputStream in)(Code)
Constructs a new DataInputStream on the InputStream in. All reads can now be filtered through this stream. Note that data read by this Stream is not in a human readable format and was most likely created by a DataOutputStream.
Parameters:
  in - the target InputStream to filter reads on.
See Also:   DataOutputStream
See Also:   RandomAccessFile




Method Detail
decodeUTF
String decodeUTF(int utfSize) throws IOException(Code)



read
final public int read(byte[] buffer) throws IOException(Code)
Reads bytes from the source stream into the byte array buffer. The number of bytes actually read is returned.
Parameters:
  buffer - the buffer to read bytes into the number of bytes actually read or -1 if end of stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.write(byte[])
See Also:   DataOutput.write(byte[]intint)



read
final public int read(byte[] buffer, int offset, int length) throws IOException(Code)
Read at most length bytes from this DataInputStream and stores them in byte array buffer starting at offset. Answer the number of bytes actually read or -1 if no bytes were read and end of stream was encountered.
Parameters:
  buffer - the byte array in which to store the read bytes.
Parameters:
  offset - the offset in buffer to store the read bytes.
Parameters:
  length - the maximum number of bytes to store in buffer. the number of bytes actually read or -1 if end of stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.write(byte[])
See Also:   DataOutput.write(byte[]intint)



readBoolean
final public boolean readBoolean() throws IOException(Code)
Reads a boolean from this stream. the next boolean value from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeBoolean(boolean)



readByte
final public byte readByte() throws IOException(Code)
Reads an 8-bit byte value from this stream. the next byte value from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeByte(int)



readChar
final public char readChar() throws IOException(Code)



readDouble
final public double readDouble() throws IOException(Code)
Reads a 64-bit double value from this stream. the next double value from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeDouble(double)



readFloat
final public float readFloat() throws IOException(Code)
Reads a 32-bit float value from this stream. the next float value from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeFloat(float)



readFully
final public void readFully(byte[] buffer) throws IOException(Code)
Reads bytes from this stream into the byte array buffer. This method will block until buffer.length number of bytes have been read.
Parameters:
  buffer - to read bytes into
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.write(byte[])
See Also:   DataOutput.write(byte[]intint)



readFully
final public void readFully(byte[] buffer, int offset, int length) throws IOException(Code)
Reads bytes from this stream and stores them in the byte array buffer starting at the position offset. This method blocks until count bytes have been read.
Parameters:
  buffer - the byte array into which the data is read
Parameters:
  offset - the offset the operation start at
Parameters:
  length - the maximum number of bytes to read
throws:
  IOException - if a problem occurs while reading from this stream
throws:
  EOFException - if reaches the end of the stream before enough bytes havebeen read
See Also:   java.io.DataInput.readFully(byte[]intint)



readInt
final public int readInt() throws IOException(Code)
Reads a 32-bit integer value from this stream. the next int value from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeInt(int)



readLine
final public String readLine() throws IOException(Code)
Answers a String representing the next line of text available in this BufferedReader. A line is represented by 0 or more characters followed by '\n', '\r', "\n\r" or end of stream. The String does not include the newline sequence. the contents of the line or null if no characters were readbefore end of stream.
throws:
  IOException - If the DataInputStream is already closed or some other IOerror occurs.



readLong
final public long readLong() throws IOException(Code)
Reads a 64-bit long value from this stream. the next long value from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeLong(long)



readShort
final public short readShort() throws IOException(Code)
Reads a 16-bit short value from this stream. the next short value from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeShort(int)



readUTF
final public String readUTF() throws IOException(Code)
Reads a UTF format String from this Stream. the next UTF String from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeUTF(java.lang.String)



readUTF
final public static String readUTF(DataInput in) throws IOException(Code)
Reads a UTF format String from the DataInput Stream in.
Parameters:
  in - the input stream to read from the next UTF String from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeUTF(java.lang.String)



readUnsignedByte
final public int readUnsignedByte() throws IOException(Code)
Reads an unsigned 8-bit byte value from this stream and returns it as an int. the next unsigned byte value from the source stream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeByte(int)



readUnsignedShort
final public int readUnsignedShort() throws IOException(Code)
Reads a 16-bit unsigned short value from this stream and returns it as an int. the next unsigned short value from the sourcestream.
throws:
  IOException - If a problem occurs reading from this DataInputStream.
See Also:   DataOutput.writeShort(int)



skipBytes
final public int skipBytes(int count) throws IOException(Code)
Skips count number of bytes in this stream. Subsequent read()'s will not return these bytes unless reset() is used.
Parameters:
  count - the number of bytes to skip. the number of bytes actually skipped.
throws:
  IOException - If the stream is already closed or another IOExceptionoccurs.



Fields inherited from java.io.FilterInputStream
protected InputStream in(Code)(Java Doc)

Methods inherited from java.io.FilterInputStream
public int available() throws IOException(Code)(Java Doc)
public void close() throws IOException(Code)(Java Doc)
public synchronized void mark(int readlimit)(Code)(Java Doc)
public boolean markSupported()(Code)(Java Doc)
public int read() throws IOException(Code)(Java Doc)
public int read(byte[] buffer) throws IOException(Code)(Java Doc)
public int read(byte[] buffer, int offset, int count) throws IOException(Code)(Java Doc)
public synchronized void reset() throws IOException(Code)(Java Doc)
public long skip(long count) throws IOException(Code)(Java Doc)

Methods inherited from java.io.InputStream
public int available() throws IOException(Code)(Java Doc)
public void close() throws IOException(Code)(Java Doc)
public void mark(int readlimit)(Code)(Java Doc)
public boolean markSupported()(Code)(Java Doc)
abstract public int read() throws IOException(Code)(Java Doc)
public int read(byte b) throws IOException(Code)(Java Doc)
public int read(byte b, int offset, int length) throws IOException(Code)(Java Doc)
public synchronized void reset() throws IOException(Code)(Java Doc)
public long skip(long n) throws IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) 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.