IT. Expert System.

Android Reference

ObjectOutputStream


java.io

Class ObjectOutputStream

    • Constructor Detail

      • ObjectOutputStream

        protected ObjectOutputStream()
                              throws IOException
        Constructs a new ObjectOutputStream. This default constructor can be used by subclasses that do not want to use the public constructor if it allocates unneeded data.
        Throws:
        IOException - if an error occurs when creating this stream.
      • ObjectOutputStream

        public ObjectOutputStream(OutputStream output)
                           throws IOException
        Constructs a new ObjectOutputStream that writes to the OutputStream output.
        Parameters:
        output - the non-null OutputStream to filter writes on.
        Throws:
        IOException - if an error occurs while writing the object stream header
    • Method Detail

      • annotateClass

        protected void annotateClass(Class<?> aClass)
                              throws IOException
        Writes optional information for class aClass to the output stream. This optional data can be read when deserializing the class descriptor (ObjectStreamClass) for this class from an input stream. By default, no extra data is saved.
        Parameters:
        aClass - the class to annotate.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        ObjectInputStream.resolveClass(ObjectStreamClass)
      • annotateProxyClass

        protected void annotateProxyClass(Class<?> aClass)
                                   throws IOException
        Writes optional information for a proxy class to the target stream. This optional data can be read when deserializing the proxy class from an input stream. By default, no extra data is saved.
        Parameters:
        aClass - the proxy class to annotate.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        ObjectInputStream.resolveProxyClass(String[])
      • defaultWriteObject

        public void defaultWriteObject()
                                throws IOException
        Default method to write objects to this stream. Serializable fields defined in the object's class and superclasses are written to the output stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        NotActiveException - if this method is not called from writeObject().
        See Also:
        ObjectInputStream.defaultReadObject()
      • drain

        protected void drain()
                      throws IOException
        Writes buffered data to the target stream. This is similar to flush but the flush is not propagated to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
      • enableReplaceObject

        protected boolean enableReplaceObject(boolean enable)
        Enables object replacement for this stream. By default this is not enabled. Only trusted subclasses (loaded with system class loader) are allowed to change this status.
        Parameters:
        enable - true to enable object replacement; false to disable it.
        Returns:
        the previous setting.
        See Also:
        replaceObject(java.lang.Object), ObjectInputStream.enableResolveObject(boolean)
      • flush

        public void flush()
                   throws IOException
        Writes buffered data to the target stream and calls the flush method of the target stream.
        Specified by:
        flush in interface Flushable
        Specified by:
        flush in interface ObjectOutput
        Overrides:
        flush in class OutputStream
        Throws:
        IOException - if an error occurs while writing to or flushing the output stream.
      • putFields

        public ObjectOutputStream.PutField putFields()
                                              throws IOException
        Gets this stream's PutField object. This object provides access to the persistent fields that are eventually written to the output stream. It is used to transfer the values from the fields of the object that is currently being written to the persistent fields.
        Returns:
        the PutField object from which persistent fields can be accessed by name.
        Throws:
        IOException - if an I/O error occurs.
        NotActiveException - if this method is not called from writeObject().
        See Also:
        ObjectInputStream.defaultReadObject()
      • reset

        public void reset()
                   throws IOException
        Resets the state of this stream. A marker is written to the stream, so that the corresponding input stream will also perform a reset 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 reset() is called during the serialization of an object.
      • write

        public void write(byte[] buffer,
                 int offset,
                 int length)
                   throws IOException
        Writes count bytes from the byte array buffer starting at offset index to the target stream. Blocks until all bytes are written.
        Specified by:
        write in interface DataOutput
        Specified by:
        write in interface ObjectOutput
        Overrides:
        write in class OutputStream
        Parameters:
        buffer - the buffer to write.
        offset - the index of the first byte in buffer to write.
        length - the number of bytes from buffer to write to the output stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
      • write

        public void write(int value)
                   throws IOException
        Writes a single byte to the target stream. Only the least significant byte of the integer value is written to the stream. Blocks until the byte is actually written.
        Specified by:
        write in interface DataOutput
        Specified by:
        write in interface ObjectOutput
        Specified by:
        write in class OutputStream
        Parameters:
        value - the byte to write.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        DataInput.readByte()
      • writeBoolean

        public void writeBoolean(boolean value)
                          throws IOException
        Writes a boolean to the target stream.
        Specified by:
        writeBoolean in interface DataOutput
        Parameters:
        value - the boolean value to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        DataInput.readBoolean()
      • writeBytes

        public void writeBytes(String value)
                        throws IOException
        Writes the string value as a sequence of bytes to the target stream. Only the least significant byte of each character in the string is written.
        Specified by:
        writeBytes in interface DataOutput
        Parameters:
        value - the string to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
      • writeChar

        public void writeChar(int value)
                       throws IOException
        Writes a character (16 bit) to the target stream.
        Specified by:
        writeChar in interface DataOutput
        Parameters:
        value - the character to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        DataInput.readChar()
      • writeChars

        public void writeChars(String value)
                        throws IOException
        Writes the string value as a sequence of characters to the target stream.
        Specified by:
        writeChars in interface DataOutput
        Parameters:
        value - the string to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        DataInput.readChar()
      • writeDouble

        public void writeDouble(double value)
                         throws IOException
        Writes a double (64 bit) to the target stream.
        Specified by:
        writeDouble in interface DataOutput
        Parameters:
        value - the double to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        DataInput.readDouble()
      • writeFields

        public void writeFields()
                         throws IOException
        Writes the fields of the object currently being written to the target stream. The field values are buffered in the currently active PutField object, which can be accessed by calling putFields().
        Throws:
        IOException - if an error occurs while writing to the target stream.
        NotActiveException - if there are no fields to write to the target stream.
        See Also:
        putFields()
      • writeFloat

        public void writeFloat(float value)
                        throws IOException
        Writes a float (32 bit) to the target stream.
        Specified by:
        writeFloat in interface DataOutput
        Parameters:
        value - the float to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        DataInput.readFloat()
      • writeInt

        public void writeInt(int value)
                      throws IOException
        Writes an integer (32 bit) to the target stream.
        Specified by:
        writeInt in interface DataOutput
        Parameters:
        value - the integer to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        DataInput.readInt()
      • writeLong

        public void writeLong(long value)
                       throws IOException
        Writes a long (64 bit) to the target stream.
        Specified by:
        writeLong in interface DataOutput
        Parameters:
        value - the long to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        DataInput.readLong()
      • writeClassDescriptor

        protected void writeClassDescriptor(ObjectStreamClass classDesc)
                                     throws IOException
        Writes a class descriptor to the target stream.
        Parameters:
        classDesc - the class descriptor to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
      • writeUnshared

        public void writeUnshared(Object object)
                           throws IOException
        Writes an unshared object to the target stream. This method is identical to writeObject, except that it always writes a new object to the stream versus the use of back-referencing for identical objects by writeObject.
        Parameters:
        object - the object to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
        See Also:
        ObjectInputStream.readUnshared()
      • writeObjectOverride

        protected void writeObjectOverride(Object object)
                                    throws IOException
        Method to be overridden by subclasses to write object to the target stream.
        Parameters:
        object - the object to write to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.
      • writeStreamHeader

        protected void writeStreamHeader()
                                  throws IOException
        Writes the ObjectOutputStream header to the target stream.
        Throws:
        IOException - if an error occurs while writing to the target stream.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 2367 / . Delta: 0.05645 с