Source Code Cross Referenced for IDataSink.java in  » Web-Server » xsocket » org » xsocket » 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 » Web Server » xsocket » org.xsocket 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Copyright (c) xsocket.org, 2006 - 2008. All rights reserved.
003:         *
004:         *  This library is free software; you can redistribute it and/or
005:         *  modify it under the terms of the GNU Lesser General Public
006:         *  License as published by the Free Software Foundation; either
007:         *  version 2.1 of the License, or (at your option) any later version.
008:         *
009:         *  This library is distributed in the hope that it will be useful,
010:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         *  Lesser General Public License for more details.
013:         *
014:         *  You should have received a copy of the GNU Lesser General Public
015:         *  License along with this library; if not, write to the Free Software
016:         *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         *
018:         * Please refer to the LGPL license at: http://www.gnu.org/copyleft/lesser.txt
019:         * The latest copy of this software may be found on http://www.xsocket.org/
020:         */
021:        package org.xsocket;
022:
023:        import java.io.IOException;
024:        import java.nio.BufferOverflowException;
025:        import java.nio.ByteBuffer;
026:        import java.nio.channels.GatheringByteChannel;
027:        import java.nio.channels.ReadableByteChannel;
028:        import java.nio.channels.WritableByteChannel;
029:        import java.util.List;
030:
031:        /**
032:         * A data sink is an I/O resource capable of receiving data.
033:         * 
034:         * @author grro@xsocket.org
035:         */
036:        public interface IDataSink {
037:
038:            /**
039:             * writes a byte to the data sink
040:             *  
041:             * @param b   the byte to write
042:             * @return the number of written bytes
043:             * @throws BufferOverflowException  If the no enough space is available
044:             * @throws IOException If some other I/O error occurs
045:             */
046:            public int write(byte b) throws IOException,
047:                    BufferOverflowException;
048:
049:            /**
050:             * writes bytes to the data sink
051:             *  
052:             * @param bytes   the bytes to write
053:             * @return the number of written bytes
054:             * @throws BufferOverflowException  If the no enough space is available 
055:             * @throws IOException If some other I/O error occurs
056:             */
057:            public int write(byte... bytes) throws IOException,
058:                    BufferOverflowException;
059:
060:            /**
061:             * writes bytes to the data sink
062:             *  
063:             * @param bytes    the bytes to write
064:             * @param offset   The offset of the sub array to be used; must be non-negative and no larger than array.length. The new buffer`s position will be set to this value.
065:             * @param length   The length of the sub array to be used; must be non-negative and no larger than array.length - offset. The new buffer`s limit will be set to offset + length.
066:             * @return the number of written bytes
067:             * @throws BufferOverflowException  If the no enough space is available 
068:             * @throws IOException If some other I/O error occurs
069:             */
070:            public int write(byte[] bytes, int offset, int length)
071:                    throws IOException, BufferOverflowException;
072:
073:            /**
074:             * {@link WritableByteChannel#write(ByteBuffer)}
075:             */
076:            public int write(ByteBuffer buffer) throws IOException,
077:                    BufferOverflowException;
078:
079:            /**
080:             * {@link GatheringByteChannel#write(ByteBuffer[])}
081:             */
082:            public long write(ByteBuffer[] buffers) throws IOException,
083:                    BufferOverflowException;
084:
085:            /**
086:             * see {@link GatheringByteChannel#write(ByteBuffer[], int, int)}
087:             */
088:            public long write(ByteBuffer[] srcs, int offset, int length)
089:                    throws IOException;
090:
091:            /**
092:             * writes a list of bytes to the data sink
093:             *  
094:             * @param buffers    the bytes to write
095:             * @return the number of written bytes
096:             * @throws BufferOverflowException  If the no enough space is available 
097:             * @throws IOException If some other I/O error occurs
098:             */
099:            public long write(List<ByteBuffer> buffers) throws IOException,
100:                    BufferOverflowException;
101:
102:            /**
103:             * writes a int to the data sink
104:             *  
105:             * @param i   the int value to write
106:             * @return the number of written bytes
107:             * @throws BufferOverflowException  If the no enough space is available 
108:             * @throws IOException If some other I/O error occurs
109:             */
110:            public int write(int i) throws IOException, BufferOverflowException;
111:
112:            /**
113:             * writes a short to the data sink
114:             *  
115:             * @param s   the short value to write
116:             * @return the number of written bytes
117:             * @throws BufferOverflowException  If the no enough space is available 
118:             * @throws IOException If some other I/O error occurs
119:             */
120:            public int write(short s) throws IOException,
121:                    BufferOverflowException;
122:
123:            /**
124:             * writes a long to the data sink
125:             *  
126:             * @param l   the int value to write
127:             * @return the number of written bytes
128:             * @throws BufferOverflowException  If the no enough space is available 
129:             * @throws IOException If some other I/O error occurs
130:             */
131:            public int write(long l) throws IOException,
132:                    BufferOverflowException;
133:
134:            /**
135:             * writes a double to the data sink
136:             *  
137:             * @param d   the int value to write
138:             * @return the number of written bytes
139:             * @throws BufferOverflowException  If the no enough space is available 
140:             * @throws IOException If some other I/O error occurs
141:             */
142:            public int write(double d) throws IOException,
143:                    BufferOverflowException;
144:
145:            /**
146:             * writes a message
147:             * 
148:             * @param message  the message to write
149:             * @return the number of written bytes
150:             * @throws BufferOverflowException  If the no enough space is available 
151:             * @throws IOException If some other I/O error occurs
152:             */
153:            public int write(String message) throws IOException,
154:                    BufferOverflowException;
155:
156:            /**
157:             * transfer the data of the source channel to this data sink
158:             * 
159:             * @param source the source channel
160:             * @return the number of transfered bytes
161:             * @throws BufferOverflowException  If the no enough space is available 
162:             * @throws IOException If some other I/O error occurs
163:             */
164:            public long transferFrom(ReadableByteChannel source)
165:                    throws IOException, BufferOverflowException;
166:
167:            /**
168:             * transfer the data of the source channel to this data sink
169:             * 
170:             * @param source     the source channel
171:             * @param chunkSize  the chunk size to use
172:             * @return the number of transfered bytes
173:             * @throws BufferOverflowException  If the no enough space is available 
174:             * @throws IOException If some other I/O error occurs
175:             */
176:            public long transferFrom(ReadableByteChannel source, int chunkSize)
177:                    throws IOException, BufferOverflowException;
178:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.