Java Doc for UniversalOutputStream.java in  » 6.0-JDK-Modules » j2me » com » sun » cdc » io » j2me » 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 » 6.0 JDK Modules » j2me » com.sun.cdc.io.j2me 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.io.OutputStream
      com.sun.cdc.io.j2me.UniversalOutputStream

All known Subclasses:   com.sun.cdc.io.j2me.datagram.DatagramObject,  com.sun.cdc.io.j2me.UniversalFilterOutputStream,
UniversalOutputStream
abstract public class UniversalOutputStream extends OutputStream implements DataOutput(Code)
This class is a combination of several J2SE stream classes. It implements the OutputStream and DataOutput interfaces. It also implements the normal set of print() and println() functions. Lastly the stream may, in certain cases, be 'seeked' and have a timeout value associated with it.

Note: Printing a "\n" or calling println() will cause just a single line-feed character to be placed in the output file.
version:
   1.0 1/7/2000





Method Summary
public  booleancheckError()
     Flush the stream and check its error state.
public  voidclose()
     Close the stream.

Note: If this method is also implemented in a subclass, this method should be called before the body of the code is executed.

public  voidflush()
     Flush the stream.

Note: If this method is also implemented in a subclass, this method should be called before the body of the code is executed.

public synchronized  voidprint(String s)
     Prints a String.
public synchronized  voidprint(char s)
     Prints an array of characters.
public  voidprint(Object obj)
     Prints an object.
public  voidprint(char c)
     Prints an character.
public  voidprint(int i)
     Prints an integer.
public  voidprint(long l)
     Prints a long.
public  voidprint(boolean b)
     Prints a boolean.
public  voidprintln()
     Prints a newline.
public synchronized  voidprintln(Object obj)
     Prints an object followed by a newline.
public synchronized  voidprintln(String s)
     Prints a string followed by a newline.
public synchronized  voidprintln(char s)
     Prints an array of characters followed by a newline.
public synchronized  voidprintln(char c)
     Prints a character followed by a newline.
public synchronized  voidprintln(int i)
     Prints an integer followed by a newline.
public synchronized  voidprintln(long l)
     Prints a long followed by a newline.
public synchronized  voidprintln(boolean b)
     Prints a boolean followed by a newline.
public  voidseek(long pos)
     Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.
public  voidsetEncoding(String enc)
     Set the encoding for text output.
public  voidsetTimeout(int time)
     Enable or disable the timeout value for I/O performed on the stream, in milliseconds.
public  voidwriteBoolean(boolean v)
     Writes a boolean to the underlying output stream as a 1-byte value.
public  voidwriteByte(int v)
     Writes out a byte to the underlying output stream as a 1-byte value.
public  voidwriteBytes(String s)
    
public  voidwriteChar(int v)
     Writes a char to the underlying output stream as a 2-byte value, high byte first.
public  voidwriteChars(String s)
     Writes a string to the underlying output stream as a sequence of characters.
public  voidwriteDouble(double v)
    
public  voidwriteFloat(float v)
     Writes a float to the underlying output stream as int bits.
public  voidwriteInt(int v)
     Writes an int to the underlying output stream as four bytes, high byte first.
public  voidwriteLong(long v)
     Writes a long to the underlying output stream as eight bytes, high byte first.
public  voidwriteShort(int v)
     Writes a short to the underlying output stream as two bytes, high byte first.
public  voidwriteUTF(String str)
     Writes a string to the underlying output stream using UTF-8 encoding in a machine-independent manner.

First, two bytes are written to the output stream as if by the writeShort method giving the number of bytes to follow.

static  intwriteUTF(String str, DataOutput out)
     Writes a string to the specified DataOutput using UTF-8 encoding in a machine-independent manner.

First, two bytes are written to out as if by the writeShort method giving the number of bytes to follow.




Method Detail
checkError
public boolean checkError()(Code)
Flush the stream and check its error state. Errors are cumulative; once the stream encounters an error, this routine will return true on all successive calls. True if the print stream has encountered an error, either on theunderlying output stream or during a format conversion.



close
public void close() throws IOException(Code)
Close the stream.

Note: If this method is also implemented in a subclass, this method should be called before the body of the code is executed. E.G.

 public void close() throws IOException {
 super.close();
 ... other things ...
 }
 <\pre>



flush
public void flush() throws IOException(Code)
Flush the stream.

Note: If this method is also implemented in a subclass, this method should be called before the body of the code is executed. E.G.

 public void flush() throws IOException {
 super.flush();
 ... other things ...
 }
 <\pre>



print
public synchronized void print(String s)(Code)
Prints a String. All the data is passed through a "Writer" to ensure that the correct character translation is performed.
Parameters:
  s - the String to be printed



print
public synchronized void print(char s)(Code)
Prints an array of characters.
Parameters:
  s - the array of chars to be printed



print
public void print(Object obj)(Code)
Prints an object.
Parameters:
  obj - the object to be printed



print
public void print(char c)(Code)
Prints an character.
Parameters:
  c - the character to be printed



print
public void print(int i)(Code)
Prints an integer.
Parameters:
  i - the integer to be printed



print
public void print(long l)(Code)
Prints a long.
Parameters:
  l - the long to be printed.



print
public void print(boolean b)(Code)
Prints a boolean.
Parameters:
  b - the boolean to be printed



println
public void println()(Code)
Prints a newline.



println
public synchronized void println(Object obj)(Code)
Prints an object followed by a newline.
Parameters:
  obj - the object to be printed



println
public synchronized void println(String s)(Code)
Prints a string followed by a newline.
Parameters:
  s - the String to be printed



println
public synchronized void println(char s)(Code)
Prints an array of characters followed by a newline.
Parameters:
  s - the array of characters to be printed



println
public synchronized void println(char c)(Code)
Prints a character followed by a newline.
Parameters:
  c - the character to be printed



println
public synchronized void println(int i)(Code)
Prints an integer followed by a newline.
Parameters:
  i - the integer to be printed



println
public synchronized void println(long l)(Code)
Prints a long followed by a newline.
Parameters:
  l - the long to be printed



println
public synchronized void println(boolean b)(Code)
Prints a boolean followed by a newline.
Parameters:
  b - the boolean to be printed



seek
public void seek(long pos) throws IOException, IllegalAccessException(Code)
Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. The offset may be set beyond the end of the file. Setting the offset beyond the end of the file does not change the file length. The file length will change only by writing after the offset has been set beyond the end of the file.

Note: This function can be used only on random access streams. other streams will result by throwing an exception.
Parameters:
  pos - the offset position, measured in bytes from thebeginning of the file, at which to set the filepointer.
exception:
  IllegalAccessException - if this input stream is sequential only
exception:
  IOException - if pos is less than0 or if an I/O error occurs.




setEncoding
public void setEncoding(String enc) throws UnsupportedEncodingException(Code)
Set the encoding for text output. All the print() routines write text through a Writer that it set, by default, to the default character encoding. This function will change the encoding to another type.
Parameters:
  enc - the encoding
exception:
  UnsupportedEncodingException - If the named encoding is not supported



setTimeout
public void setTimeout(int time) throws IOException(Code)
Enable or disable the timeout value for I/O performed on the stream, in milliseconds. With this option set to a non-zero timeout, any kind of write/print call on the stream will block for only this amount of time. If the timeout expires, a java.io.InterruptedIOException is raised, though the Socket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.
Parameters:
  time - the time in ms. 0 = forever.



writeBoolean
public void writeBoolean(boolean v) throws IOException(Code)
Writes a boolean to the underlying output stream as a 1-byte value. The value true is written out as the value (byte)1; the value false is written out as the value (byte)0. If no exception is thrown, the counter written is incremented by 1.
Parameters:
  v - a boolean value to be written.
exception:
  IOException - if an I/O error occurs.



writeByte
public void writeByte(int v) throws IOException(Code)
Writes out a byte to the underlying output stream as a 1-byte value. If no exception is thrown, the counter written is incremented by 1.
Parameters:
  v - a byte value to be written.
exception:
  IOException - if an I/O error occurs.



writeBytes
public void writeBytes(String s) throws IOException(Code)
writeBytes



writeChar
public void writeChar(int v) throws IOException(Code)
Writes a char to the underlying output stream as a 2-byte value, high byte first. If no exception is thrown, the counter written is incremented by 2.
Parameters:
  v - a char value to be written.
exception:
  IOException - if an I/O error occurs.



writeChars
public void writeChars(String s) throws IOException(Code)
Writes a string to the underlying output stream as a sequence of characters. Each character is written to the data output stream as if by the writeChar method. If no exception is thrown, the counter written is incremented by twice the length of s.
Parameters:
  s - a String value to be written.
exception:
  IOException - if an I/O error occurs.



writeDouble
public void writeDouble(double v) throws IOException(Code)



writeFloat
public void writeFloat(float v) throws IOException(Code)
Writes a float to the underlying output stream as int bits. In no exception is thrown, the counter written is incremented by 8.
Parameters:
  v - a float to be written.
exception:
  IOException - if an I/O error occurs.



writeInt
public void writeInt(int v) throws IOException(Code)
Writes an int to the underlying output stream as four bytes, high byte first. If no exception is thrown, the counter written is incremented by 4.
Parameters:
  v - an int to be written.
exception:
  IOException - if an I/O error occurs.



writeLong
public void writeLong(long v) throws IOException(Code)
Writes a long to the underlying output stream as eight bytes, high byte first. In no exception is thrown, the counter written is incremented by 8.
Parameters:
  v - a long to be written.
exception:
  IOException - if an I/O error occurs.



writeShort
public void writeShort(int v) throws IOException(Code)
Writes a short to the underlying output stream as two bytes, high byte first. If no exception is thrown, the counter written is incremented by 2.
Parameters:
  v - a short to be written.
exception:
  IOException - if an I/O error occurs.



writeUTF
public void writeUTF(String str) throws IOException(Code)
Writes a string to the underlying output stream using UTF-8 encoding in a machine-independent manner.

First, two bytes are written to the output stream as if by the writeShort method giving the number of bytes to follow. This value is the number of bytes actually written out, not the length of the string. Following the length, each character of the string is output, in sequence, using the UTF-8 encoding for the character. If no exception is thrown, the counter written is incremented by the total number of bytes written to the output stream. This will be at least two plus the length of str, and at most two plus thrice the length of str.
Parameters:
  str - a string to be written.
exception:
  IOException - if an I/O error occurs.




writeUTF
static int writeUTF(String str, DataOutput out) throws IOException(Code)
Writes a string to the specified DataOutput using UTF-8 encoding in a machine-independent manner.

First, two bytes are written to out as if by the writeShort method giving the number of bytes to follow. This value is the number of bytes actually written out, not the length of the string. Following the length, each character of the string is output, in sequence, using the UTF-8 encoding for the character. If no exception is thrown, the counter written is incremented by the total number of bytes written to the output stream. This will be at least two plus the length of str, and at most two plus thrice the length of str.
Parameters:
  str - a string to be written.
Parameters:
  out - destination to write to The number of bytes written out.
exception:
  IOException - if an I/O error occurs.




Methods inherited from java.io.OutputStream
public void close() throws IOException(Code)(Java Doc)
public void flush() throws IOException(Code)(Java Doc)
abstract public void write(int b) throws IOException(Code)(Java Doc)
public void write(byte b) throws IOException(Code)(Java Doc)
public void write(byte b, int off, int len) throws IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(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.