- Java.io - Writer
- Java.io - StringWriter
- Java.io - StringReader
- Java.io - StringBufferInputStream
- Java.io - StreamTokenizer
- Java.io - SerializablePermission
- Java.io - SequenceInputStream
- Java.io - Reader
- Java.io - RandomAccessFile
- Java.io - PushbackReader
- Java.io - PushbackInputStream
- Java.io - PrintWriter
- Java.io - PrintStream
- Java.io - PipedWriter
- Java.io - PipedReader
- Java.io - PipedOutputStream
- Java.io - PipedInputStream
- Java.io - OutputStreamWriter
- Java.io - OutputStream
- Java.io - ObjectStreamField
- Java.io - ObjectStreamClass
- io - ObjectOutputStream.PutField
- Java.io - ObjectOutputStream
- Java.io - ObjectInputStream.GetField
- Java.io - ObjectInputStream
- Java.io - LineNumberReader
- Java.io - LineNumberInputStream
- Java.io - InputStreamReader
- Java.io - InputStream
- Java.io - FilterWriter
- Java.io - FilterReader
- Java.io - FilterOutputStream
- Java.io - FilterInputStream
- Java.io - FileWriter
- Java.io - FileReader
- Java.io - FilePermission
- Java.io - FileOutputStream
- Java.io - FileInputStream
- Java.io - FileDescriptor
- Java.io - File
- Java.io - DataOutputStream
- Java.io - DataInputStream
- Java.io - Console
- Java.io - CharArrayWriter
- Java.io - CharArrayReader
- Java.io - ByteArrayOutputStream
- Java.io - ByteArrayInputStream
- Java.io - BufferedWriter
- Java.io - BufferedReader
- Java.io - BufferedOutputStream
- Java.io - BufferedInputStream
- Java.io - Home
Java.io package extras
Java.io package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.io.ObjectOutputStream Class
Introduction
The Java.io.ObjectOutputStream class writes primitive data types and graphs of Java objects to an OutputStream.The objects can be read (reconstituted) using an ObjectInputStream.
Class declaration
Following is the declaration for Java.io.ObjectOutputStream class −
pubpc class ObjectOutputStream extends OutputStream implements ObjectOutput, ObjectStreamConstants
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | protected ObjectOutputStream() This provides a way for subclasses that are completely reimplementing ObjectOutputStream to not have to allocate private data just used by this implementation of ObjectOutputStream. |
2 | ObjectOutputStream(OutputStream out) This creates an ObjectOutputStream that writes to the specified OutputStream. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Subclasses may implement this method to allow class data to be stored in the stream. |
2 | Subclasses may implement this method to store custom data in the stream along with descriptors for dynamic proxy classes. |
3 | This method closes the stream. |
4 | This method writes the non-static and non-transient fields of the current class to this stream. |
5 | This method drain any buffered data in ObjectOutputStream. |
6 | This method enable the stream to do replacement of objects in the stream. |
7 | This method flushes the stream. |
8 | This method retrieves the object used to buffer persistent fields to be written to the stream. |
9 | This method will allow trusted subclasses of ObjectOutputStream to substitute one object for another during seriapzation. |
10 | This method reset will disregard the state of any objects already written to the stream. |
11 | This method specify stream protocol version to use when writing the stream. |
12 | This method writes an array of bytes. |
13 | This method writes a sub array of bytes. |
14 | This method writes a byte. |
15 | This method writes a boolean. |
16 | This method writes an 8 bit byte. |
17 | This method writes a String as a sequence of bytes. |
18 | This method writes a 16 bit char. |
19 | This method writes a String as a sequence of chars. |
20 | This method writes the specified class descriptor to the ObjectOutputStream. |
21 | This method writes a 64 bit double. |
22 | This method writes the buffered fields to the stream. |
23 | This method writes a 32 bit float. |
24 | This method writes a 32 bit int. |
25 | This method writes a 64 bit long. |
26 | This method writes the specified object to the ObjectOutputStream. |
27 | This method is used by subclasses to override the default writeObject method. |
28 | This method writes a 16 bit short. |
29 | This method is provided so subclasses can append or prepend their own header to the stream. |
30 | This method writes an "unshared" object to the ObjectOutputStream. |
Methods inherited
This class inherits methods from the following classes −
Java.io.Object