IT. Expert System.

Android Reference

Writer


java.io

Class Writer

    • Field Summary

      Fields
      Modifier and Type Field and Description
      protected Object lock
      The object used to synchronize access to the writer.
    • Constructor Summary

      Constructors
      Modifier Constructor and Description
      protected Writer()
      Constructs a new Writer with this as the object used to synchronize critical sections.
      protected Writer(Object lock)
      Constructs a new Writer with lock used to synchronize critical sections.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      Writer append(char c)
      Appends the character c to the target.
      Writer append(CharSequence csq)
      Appends the character sequence csq to the target.
      Writer append(CharSequence csq, int start, int end)
      Appends a subsequence of the character sequence csq to the target.
      abstract void close()
      Closes this writer.
      abstract void flush()
      Flushes this writer.
      void write(char[] buf)
      Writes the entire character buffer buf to the target.
      abstract void write(char[] buf, int offset, int count)
      Writes count characters starting at offset in buf to the target.
      void write(int oneChar)
      Writes one character to the target.
      void write(String str)
      Writes the characters from the specified string to the target.
      void write(String str, int offset, int count)
      Writes count characters from str starting at offset to the target.
    • Field Detail

      • lock

        protected Object lock
        The object used to synchronize access to the writer.
    • Constructor Detail

      • Writer

        protected Writer()
        Constructs a new Writer with this as the object used to synchronize critical sections.
      • Writer

        protected Writer(Object lock)
        Constructs a new Writer with lock used to synchronize critical sections.
        Parameters:
        lock - the Object used to synchronize critical sections.
        Throws:
        NullPointerException - if lock is null.
    • Method Detail

      • close

        public abstract void close()
                            throws IOException
        Closes this writer. Implementations of this method should free any resources associated with the writer.
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface AutoCloseable
        Throws:
        IOException - if an error occurs while closing this writer.
      • flush

        public abstract void flush()
                            throws IOException
        Flushes this writer. Implementations of this method should ensure that all buffered characters are written to the target.
        Specified by:
        flush in interface Flushable
        Throws:
        IOException - if an error occurs while flushing this writer.
      • write

        public void write(char[] buf)
                   throws IOException
        Writes the entire character buffer buf to the target.
        Parameters:
        buf - the non-null array containing characters to write.
        Throws:
        IOException - if this writer is closed or another I/O error occurs.
      • write

        public abstract void write(char[] buf,
                 int offset,
                 int count)
                            throws IOException
        Writes count characters starting at offset in buf to the target.
        Parameters:
        buf - the non-null character array to write.
        offset - the index of the first character in buf to write.
        count - the maximum number of characters to write.
        Throws:
        IndexOutOfBoundsException - if offset < 0 or count < 0, or if offset + count is greater than the size of buf.
        IOException - if this writer is closed or another I/O error occurs.
      • write

        public void write(int oneChar)
                   throws IOException
        Writes one character to the target. Only the two least significant bytes of the integer oneChar are written.
        Parameters:
        oneChar - the character to write to the target.
        Throws:
        IOException - if this writer is closed or another I/O error occurs.
      • write

        public void write(String str)
                   throws IOException
        Writes the characters from the specified string to the target.
        Parameters:
        str - the non-null string containing the characters to write.
        Throws:
        IOException - if this writer is closed or another I/O error occurs.
      • write

        public void write(String str,
                 int offset,
                 int count)
                   throws IOException
        Writes count characters from str starting at offset to the target.
        Parameters:
        str - the non-null string containing the characters to write.
        offset - the index of the first character in str to write.
        count - the number of characters from str to write.
        Throws:
        IOException - if this writer is closed or another I/O error occurs.
        IndexOutOfBoundsException - if offset < 0 or count < 0, or if offset + count is greater than the length of str.
      • append

        public Writer append(char c)
                      throws IOException
        Appends the character c to the target. This method works the same way as write(int).
        Specified by:
        append in interface Appendable
        Parameters:
        c - the character to append to the target stream.
        Returns:
        this writer.
        Throws:
        IOException - if this writer is closed or another I/O error occurs.
      • append

        public Writer append(CharSequence csq)
                      throws IOException
        Appends the character sequence csq to the target. This method works the same way as Writer.write(csq.toString()). If csq is null, then the string "null" is written to the target stream.
        Specified by:
        append in interface Appendable
        Parameters:
        csq - the character sequence appended to the target.
        Returns:
        this writer.
        Throws:
        IOException - if this writer is closed or another I/O error occurs.
      • append

        public Writer append(CharSequence csq,
                    int start,
                    int end)
                      throws IOException
        Appends a subsequence of the character sequence csq to the target. This method works the same way as Writer.writer(csq.subsequence(start, end).toString()). If csq is null, then the specified subsequence of the string "null" will be written to the target.
        Specified by:
        append in interface Appendable
        Parameters:
        csq - the character sequence appended to the target.
        start - the index of the first char in the character sequence appended to the target.
        end - the index of the character following the last character of the subsequence appended to the target.
        Returns:
        this writer.
        Throws:
        IOException - if this writer is closed or another I/O error occurs.
        IndexOutOfBoundsException - if start > end, start < 0, end < 0 or either start or end are greater or equal than the length of csq.


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: 1443 / 158696594. Delta: 0.02442 с