Source Code Cross Referenced for DataInput.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 Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */
017:
018:        package java.io;
019:
020:        /**
021:         * DataInput is an interface which declares methods for reading in typed data
022:         * from a Stream. Typically, this stream has been written by a class which
023:         * implements DataOutput. Types that can be read include byte, 16-bit short,
024:         * 32-bit int, 32-bit float, 64-bit long, 64-bit double, byte strings, and UTF
025:         * Strings.
026:         * 
027:         * @see DataInputStream
028:         * @see RandomAccessFile
029:         */
030:        public interface DataInput {
031:            /**
032:             * Reads a boolean from this stream.
033:             * 
034:             * @return the next boolean value from the source stream.
035:             * 
036:             * @throws IOException
037:             *             If a problem occurs reading from this stream.
038:             * 
039:             * @see DataOutput#writeBoolean(boolean)
040:             */
041:            public abstract boolean readBoolean() throws IOException;
042:
043:            /**
044:             * Reads an 8-bit byte value from this stream.
045:             * 
046:             * @return the next byte value from the source stream.
047:             * 
048:             * @throws IOException
049:             *             If a problem occurs reading from this stream.
050:             * 
051:             * @see DataOutput#writeByte(int)
052:             */
053:            public abstract byte readByte() throws IOException;
054:
055:            /**
056:             * Reads a 16-bit character value from this stream.
057:             * 
058:             * @return the next <code>char</code> value from the source stream.
059:             * 
060:             * @throws IOException
061:             *             If a problem occurs reading from this stream.
062:             * 
063:             * @see DataOutput#writeChar(int)
064:             */
065:            public abstract char readChar() throws IOException;
066:
067:            /**
068:             * Reads a 64-bit <code>double</code> value from this stream.
069:             * 
070:             * @return the next <code>double</code> value from the source stream.
071:             * 
072:             * @throws IOException
073:             *             If a problem occurs reading from this stream.
074:             * 
075:             * @see DataOutput#writeDouble(double)
076:             */
077:            public abstract double readDouble() throws IOException;
078:
079:            /**
080:             * Reads a 32-bit <code>float</code> value from this stream.
081:             * 
082:             * @return the next <code>float</code> value from the source stream.
083:             * 
084:             * @throws IOException
085:             *             If a problem occurs reading from this stream.
086:             * 
087:             * @see DataOutput#writeFloat(float)
088:             */
089:            public abstract float readFloat() throws IOException;
090:
091:            /**
092:             * Reads bytes from this stream into the byte array <code>buffer</code>.
093:             * This method will block until <code>buffer.length</code> number of bytes
094:             * have been read.
095:             * 
096:             * @param buffer
097:             *            the buffer to read bytes into
098:             * 
099:             * @throws IOException
100:             *             If a problem occurs reading from this stream.
101:             * 
102:             * @see DataOutput#write(byte[])
103:             * @see DataOutput#write(byte[], int, int)
104:             */
105:            public abstract void readFully(byte[] buffer) throws IOException;
106:
107:            /**
108:             * Read bytes from this stream and stores them in byte array
109:             * <code>buffer</code> starting at offset <code>offset</code>. This
110:             * method blocks until <code>count</code> number of bytes have been read.
111:             * 
112:             * @param buffer
113:             *            the byte array in which to store the read bytes.
114:             * @param offset
115:             *            the offset in <code>buffer</code> to store the read bytes.
116:             * @param count
117:             *            the maximum number of bytes to store in <code>buffer</code>.
118:             * 
119:             * @throws IOException
120:             *             If a problem occurs reading from this stream.
121:             * 
122:             * @see DataOutput#write(byte[])
123:             * @see DataOutput#write(byte[], int, int)
124:             */
125:            public abstract void readFully(byte[] buffer, int offset, int count)
126:                    throws IOException;
127:
128:            /**
129:             * Reads a 32-bit integer value from this stream.
130:             * 
131:             * @return the next <code>int</code> value from the source stream.
132:             * 
133:             * @throws IOException
134:             *             If a problem occurs reading from this stream.
135:             * 
136:             * @see DataOutput#writeInt(int)
137:             */
138:            public abstract int readInt() throws IOException;
139:
140:            /**
141:             * Answers a <code>String</code> representing the next line of text
142:             * available in this BufferedReader. A line is represented by 0 or more
143:             * characters followed by <code>'\n'</code>, <code>'\r'</code>,
144:             * <code>"\n\r"</code> or end of stream. The <code>String</code> does
145:             * not include the newline sequence.
146:             * 
147:             * @return the contents of the line or null if no characters were read
148:             *         before end of stream.
149:             * 
150:             * @throws IOException
151:             *             If a problem occurs reading from this stream.
152:             */
153:            public abstract String readLine() throws IOException;
154:
155:            /**
156:             * Reads a 64-bit <code>long</code> value from this stream.
157:             * 
158:             * @return the next <code>long</code> value from the source stream.
159:             * 
160:             * @throws IOException
161:             *             If a problem occurs reading from this stream.
162:             * 
163:             * @see DataOutput#writeLong(long)
164:             */
165:            public abstract long readLong() throws IOException;
166:
167:            /**
168:             * Reads a 16-bit <code>short</code> value from this stream.
169:             * 
170:             * @return the next <code>short</code> value from the source stream.
171:             * 
172:             * @throws IOException
173:             *             If a problem occurs reading from this stream.
174:             * 
175:             * @see DataOutput#writeShort(int)
176:             */
177:            public abstract short readShort() throws IOException;
178:
179:            /**
180:             * Reads an unsigned 8-bit <code>byte</code> value from this stream and
181:             * returns it as an int.
182:             * 
183:             * @return the next unsigned byte value from the source stream.
184:             * 
185:             * @throws IOException
186:             *             If a problem occurs reading from this stream.
187:             * 
188:             * @see DataOutput#writeByte(int)
189:             */
190:            public abstract int readUnsignedByte() throws IOException;
191:
192:            /**
193:             * Reads a 16-bit unsigned <code>short</code> value from this stream and
194:             * returns it as an int.
195:             * 
196:             * @return the next unsigned <code>short</code> value from the source
197:             *         stream.
198:             * 
199:             * @throws IOException
200:             *             If a problem occurs reading from this stream.
201:             * 
202:             * @see DataOutput#writeShort(int)
203:             */
204:            public abstract int readUnsignedShort() throws IOException;
205:
206:            /**
207:             * Reads a UTF format String from this Stream.
208:             * 
209:             * @return the next UTF String from the source stream.
210:             * 
211:             * @throws IOException
212:             *             If a problem occurs reading from this stream.
213:             * 
214:             * @see DataOutput#writeUTF(java.lang.String)
215:             */
216:            public abstract String readUTF() throws IOException;
217:
218:            /**
219:             * Skips <code>count</code> number of bytes in this stream. Subsequent
220:             * <code>read()</code>'s will not return these bytes unless
221:             * <code>reset()</code> is used.
222:             * 
223:             * @param count
224:             *            the number of bytes to skip.
225:             * @return the number of bytes actually skipped.
226:             * 
227:             * @throws IOException
228:             *             If a problem occurs reading from this stream.
229:             */
230:            public abstract int skipBytes(int count) throws IOException;
231:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.