Java Doc for ObjectOutputStream.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.OutputStream
      java.io.ObjectOutputStream

ObjectOutputStream
public class ObjectOutputStream extends OutputStream implements ObjectOutput,ObjectStreamConstants(Code)
An ObjectOutputStream can be used to save Java objects into a stream where the objects can be loaded later with an ObjectInputStream. Primitive data (ints, bytes, chars, etc) can also be saved.
See Also:   ObjectInputStream
See Also:   ObjectOutput
See Also:   Serializable
See Also:   Externalizable

Inner Class :abstract public static class PutField


Constructor Summary
protected  ObjectOutputStream()
     Constructs a new ObjectOutputStream.
public  ObjectOutputStream(OutputStream output)
     Constructs a new ObjectOutputStream on the OutputStream output.

Method Summary
protected  voidannotateClass(Class aClass)
     Writes optional information for class aClass into the stream represented by the receiver.
protected  voidannotateProxyClass(Class aClass)
     Writes optional information for a proxy class into the stream represented by the receiver.
public  voidclose()
     Close this ObjectOutputStream.
public  voiddefaultWriteObject()
     Default method to write objects into the receiver.
protected  voiddrain()
     Flushes buffered primitive data into the receiver.
protected  booleanenableReplaceObject(boolean enable)
     Enables/disables object replacement for the receiver.
public  voidflush()
     Flush this ObjectOutputStream.
public  PutFieldputFields()
     Return the PutField object for the receiver.
protected  ObjectreplaceObject(Object object)
     If enableReplaceObject() was activated, computes the replacement object for the original object object and returns the replacement.
public  voidreset()
     Reset the receiver.
public  voiduseProtocolVersion(int version)
     Set the receiver to use the given protocol version.
public  voidwrite(byte[] buffer)
     Writes the entire contents of the byte array buffer to this ObjectOutputStream.
public  voidwrite(byte[] buffer, int offset, int length)
     Writes length bytes from the byte array buffer starting at offset offset to the ObjectOutputStream.
public  voidwrite(int value)
     Write one byte (value) into the receiver's underlying stream.
Parameters:
  value - The primitive data to write.
public  voidwriteBoolean(boolean value)
     Write primitive data of type boolean (value)into the receiver's underlying stream.
public  voidwriteByte(int value)
     Write primitive data of type byte (value)into the receiver's underlying stream.
public  voidwriteBytes(String value)
     Write a String as a sequence of bytes (only lower-order 8 bits of each char are written), as primitive data (value) into the receiver's underlying stream.
public  voidwriteChar(int value)
     Write primitive data of type char (value)into the receiver's underlying stream.
public  voidwriteChars(String value)
     Write a String as a sequence of char, as primitive data (value) into the receiver's underlying stream.
protected  voidwriteClassDescriptor(ObjectStreamClass classDesc)
     Write class descriptor classDesc into the receiver.
public  voidwriteDouble(double value)
     Write primitive data of type double (value)into the receiver's underlying stream.
public  voidwriteFields()
     Write the fields of the object being dumped.
public  voidwriteFloat(float value)
     Write primitive data of type float (value)into the receiver's underlying stream.
public  voidwriteInt(int value)
     Write primitive data of type int (value)into the receiver's underlying stream.
public  voidwriteLong(long value)
     Write primitive data of type long (value)into the receiver's underlying stream.
final public  voidwriteObject(Object object)
     Write object object into the receiver's underlying stream.
protected  voidwriteObjectOverride(Object object)
     Method to be overridden by subclasses to write object into the receiver's underlying stream.
public  voidwriteShort(int value)
     Write primitive data of type short (value)into the receiver's underlying stream.
protected  voidwriteStreamHeader()
     Writes the ObjectOutputStream header into the underlying stream.
public  voidwriteUTF(String value)
     Write primitive data of type String (value) in UTF format into the receiver's underlying stream.
public  voidwriteUnshared(Object object)
     Write object object into the receiver's underlying stream unshared with previously written identical objects.


Constructor Detail
ObjectOutputStream
protected ObjectOutputStream() throws IOException, SecurityException(Code)
Constructs a new ObjectOutputStream. The representation and proper initialization is in the hands of subclasses.
throws:
  IOException -
throws:
  SecurityException - if subclassing this is not allowed
See Also:   SecurityManager.checkPermission(java.security.Permission)



ObjectOutputStream
public ObjectOutputStream(OutputStream output) throws IOException(Code)
Constructs a new ObjectOutputStream on the OutputStream output. All writes are now filtered through this stream.
Parameters:
  output - The non-null OutputStream to filter writes on.
throws:
  IOException - If an IO exception happened when writing the object streamheader




Method Detail
annotateClass
protected void annotateClass(Class aClass) throws IOException(Code)
Writes optional information for class aClass into the stream represented by the receiver. This optional data can be read when deserializing the class descriptor (ObjectStreamClass) for this class from the input stream. By default no extra data is saved.
Parameters:
  aClass - The class to annotate
throws:
  IOException - If an IO exception happened when annotating the class.
See Also:   ObjectInputStream.resolveClass



annotateProxyClass
protected void annotateProxyClass(Class aClass) throws IOException(Code)
Writes optional information for a proxy class into the stream represented by the receiver. This optional data can be read when deserializing the proxy class from the input stream. By default no extra data is saved.
Parameters:
  aClass - The proxy class to annotate
throws:
  IOException - If an IO exception happened when annotating the class.
See Also:   ObjectInputStream.resolveProxyClass



close
public void close() throws IOException(Code)
Close this ObjectOutputStream. Any buffered data is flushed. This implementation closes the target stream.
throws:
  IOException - If an error occurs attempting to close this stream.



defaultWriteObject
public void defaultWriteObject() throws IOException(Code)
Default method to write objects into the receiver. Fields defined in the object's class and superclasses (which are Serializable) will be saved.
throws:
  IOException - If an IO error occurs attempting to write the object data
See Also:   ObjectInputStream.defaultReadObject



drain
protected void drain() throws IOException(Code)
Flushes buffered primitive data into the receiver.
throws:
  IOException - If an error occurs attempting to drain the data



enableReplaceObject
protected boolean enableReplaceObject(boolean enable) throws SecurityException(Code)
Enables/disables object replacement for the receiver. By default this is not enabled. Only trusted subclasses (loaded with system class loader) can override this behavior.
Parameters:
  enable - if true, enables replacement. If false, disables replacement. boolean the previous configuration (if it was enabled ordisabled)
throws:
  SecurityException - If the class of the receiver is not trusted
See Also:   ObjectOutputStream.replaceObject
See Also:   ObjectInputStream.enableResolveObject



flush
public void flush() throws IOException(Code)
Flush this ObjectOutputStream. Any pending writes to the underlying stream are written out when this method is invoked.
throws:
  IOException - If an error occurs attempting to flush thisObjectOutputStream.



putFields
public PutField putFields() throws IOException(Code)
Return the PutField object for the receiver. This allows users to transfer values from actual object fields in the object being dumped to the emulated fields represented by the PutField returned by this method. the PutFieldObject for the receiver
throws:
  IOException - If an IO error occurs
throws:
  NotActiveException - If this method is not called from writeObject()
See Also:   ObjectInputStream.defaultReadObject



replaceObject
protected Object replaceObject(Object object) throws IOException(Code)
If enableReplaceObject() was activated, computes the replacement object for the original object object and returns the replacement. Otherwise returns object.
Parameters:
  object - Original object for which a replacement may be defined a possibly new, replacement object for object
throws:
  IOException - If any IO problem occurred when trying to resolve the object.
See Also:   ObjectOutputStream.enableReplaceObject
See Also:   ObjectInputStream.enableResolveObject
See Also:   ObjectInputStream.resolveObject



reset
public void reset() throws IOException(Code)
Reset the receiver. A marker is written to the stream, so that deserialization will also perform a rest at the same point. Objects previously written are no longer remembered, so they will be written again (instead of a cyclical reference) if found in the object graph.
throws:
  IOException - If any IO problem occurred when trying to reset the receiver



useProtocolVersion
public void useProtocolVersion(int version) throws IOException(Code)
Set the receiver to use the given protocol version.
Parameters:
  version - protocol version to be used
throws:
  IOException - If an IO error occurs



write
public void write(byte[] buffer) throws IOException(Code)
Writes the entire contents of the byte array buffer to this ObjectOutputStream.
Parameters:
  buffer - the buffer to be written
throws:
  IOException - If an error occurs attempting to write to thisObjectOutputStream.



write
public void write(byte[] buffer, int offset, int length) throws IOException(Code)
Writes length bytes from the byte array buffer starting at offset offset to the ObjectOutputStream.
Parameters:
  buffer - the buffer to be written
Parameters:
  offset - offset in buffer to get bytes
Parameters:
  length - number of bytes in buffer to write
throws:
  IOException - If an error occurs attempting to write to this OutputStream.



write
public void write(int value) throws IOException(Code)
Write one byte (value) into the receiver's underlying stream.
Parameters:
  value - The primitive data to write. Only the lower byte is written.
throws:
  IOException - If an IO exception happened when writing the byte.



writeBoolean
public void writeBoolean(boolean value) throws IOException(Code)
Write primitive data of type boolean (value)into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeByte
public void writeByte(int value) throws IOException(Code)
Write primitive data of type byte (value)into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeBytes
public void writeBytes(String value) throws IOException(Code)
Write a String as a sequence of bytes (only lower-order 8 bits of each char are written), as primitive data (value) into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeChar
public void writeChar(int value) throws IOException(Code)
Write primitive data of type char (value)into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeChars
public void writeChars(String value) throws IOException(Code)
Write a String as a sequence of char, as primitive data (value) into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeClassDescriptor
protected void writeClassDescriptor(ObjectStreamClass classDesc) throws IOException(Code)
Write class descriptor classDesc into the receiver.
Parameters:
  classDesc - The ObjectStreamClass object to dump
throws:
  IOException - If an IO exception happened when writing the classdescriptor.



writeDouble
public void writeDouble(double value) throws IOException(Code)
Write primitive data of type double (value)into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeFields
public void writeFields() throws IOException(Code)
Write the fields of the object being dumped. The stream will use the currently active PutField object, allowing users to dump emulated fields, for cross-loading compatibility when a class definition changes.
throws:
  IOException - If an IO error occurs
See Also:   ObjectOutputStream.putFields



writeFloat
public void writeFloat(float value) throws IOException(Code)
Write primitive data of type float (value)into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeInt
public void writeInt(int value) throws IOException(Code)
Write primitive data of type int (value)into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeLong
public void writeLong(long value) throws IOException(Code)
Write primitive data of type long (value)into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeObject
final public void writeObject(Object object) throws IOException(Code)
Write object object into the receiver's underlying stream.
Parameters:
  object - The object to write
throws:
  IOException - If an IO exception happened when writing the object
See Also:   ObjectInputStream.readObject



writeObjectOverride
protected void writeObjectOverride(Object object) throws IOException(Code)
Method to be overridden by subclasses to write object into the receiver's underlying stream.
Parameters:
  object - the object
throws:
  IOException - If an IO exception happened when writing the object



writeShort
public void writeShort(int value) throws IOException(Code)
Write primitive data of type short (value)into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeStreamHeader
protected void writeStreamHeader() throws IOException(Code)
Writes the ObjectOutputStream header into the underlying stream.
throws:
  IOException - If an IO exception happened when writing the stream header.



writeUTF
public void writeUTF(String value) throws IOException(Code)
Write primitive data of type String (value) in UTF format into the receiver's underlying stream.
Parameters:
  value - The primitive data to write
throws:
  IOException - If an IO exception happened when writing the primitive data.



writeUnshared
public void writeUnshared(Object object) throws IOException(Code)
Write object object into the receiver's underlying stream unshared with previously written identical objects.
Parameters:
  object - The object to write
throws:
  IOException - If an IO exception happened when writing the object
See Also:   ObjectInputStream.readObject



Methods inherited from java.io.OutputStream
public void close() throws IOException(Code)(Java Doc)
public void flush() throws IOException(Code)(Java Doc)
public void write(byte buffer) throws IOException(Code)(Java Doc)
public void write(byte buffer, int offset, int count) throws IOException(Code)(Java Doc)
abstract public void write(int oneByte) 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.