IT. Expert System.

Android Reference

StringReader


java.io

Class StringReader

    • Field Summary

    • Constructor Summary

      Constructors
      Constructor and Description
      StringReader(String str)
      Construct a new StringReader with str as source.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      void close()
      Closes this reader.
      void mark(int readLimit)
      Sets a mark position in this reader.
      boolean markSupported()
      Indicates whether this reader supports the mark() and reset() methods.
      int read()
      Reads a single character from the source string and returns it as an integer with the two higher-order bytes set to 0.
      int read(char[] buf, int offset, int len)
      Reads at most len characters from the source string and stores them at offset in the character array buf.
      boolean ready()
      Indicates whether this reader is ready to be read without blocking.
      void reset()
      Resets this reader's position to the last mark() location.
      long skip(long charCount)
      Moves charCount characters in the source string.
    • Constructor Detail

      • StringReader

        public StringReader(String str)
        Construct a new StringReader with str as source. The size of the reader is set to the length() of the string and the Object to synchronize access through is set to str.
        Parameters:
        str - the source string for this reader.
    • Method Detail

      • close

        public void close()
        Closes this reader. Once it is closed, read operations on this reader will throw an IOException. Only the first invocation of this method has any effect.
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in class Reader
      • mark

        public void mark(int readLimit)
                  throws IOException
        Sets a mark position in this reader. The parameter readLimit is ignored for this class. Calling reset() will reposition the reader back to the marked position.
        Overrides:
        mark in class Reader
        Parameters:
        readLimit - ignored for StringReader instances.
        Throws:
        IllegalArgumentException - if readLimit < 0.
        IOException - if this reader is closed.
        See Also:
        markSupported(), reset()
      • markSupported

        public boolean markSupported()
        Indicates whether this reader supports the mark() and reset() methods. This implementation returns true.
        Overrides:
        markSupported in class Reader
        Returns:
        always true.
      • read

        public int read()
                 throws IOException
        Reads a single character from the source string and returns it as an integer with the two higher-order bytes set to 0. Returns -1 if the end of the source string has been reached.
        Overrides:
        read in class Reader
        Returns:
        the character read or -1 if the end of the source string has been reached.
        Throws:
        IOException - if this reader is closed.
      • read

        public int read(char[] buf,
               int offset,
               int len)
                 throws IOException
        Reads at most len characters from the source string and stores them at offset in the character array buf. Returns the number of characters actually read or -1 if the end of the source string has been reached.
        Specified by:
        read in class Reader
        Parameters:
        buf - the character array to store the characters read.
        offset - the initial position in buffer to store the characters read from this reader.
        len - the maximum number of characters to read.
        Returns:
        the number of characters read or -1 if the end of the reader has been reached.
        Throws:
        IndexOutOfBoundsException - if offset < 0 or len < 0, or if offset + len is greater than the size of buf.
        IOException - if this reader is closed.
      • reset

        public void reset()
                   throws IOException
        Resets this reader's position to the last mark() location. Invocations of read() and skip() will occur from this new location. If this reader has not been marked, it is reset to the beginning of the source string.
        Overrides:
        reset in class Reader
        Throws:
        IOException - if this reader is closed.
        See Also:
        mark(int), markSupported()
      • skip

        public long skip(long charCount)
                  throws IOException
        Moves charCount characters in the source string. Unlike the overridden method, this method may skip negative skip distances: this rewinds the input so that characters may be read again. When the end of the source string has been reached, the input cannot be rewound.
        Overrides:
        skip in class Reader
        Parameters:
        charCount - the maximum number of characters to skip. Positive values skip forward; negative values skip backward.
        Returns:
        the number of characters actually skipped. This is bounded below by the number of characters already read and above by the number of characters remaining:
        -(num chars already read) <= distance skipped <= num chars remaining.
        Throws:
        IOException - if this reader is closed.
        See Also:
        mark(int), markSupported(), reset()


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: 1403 / . Delta: 0.05613 с