Tabnine Logo
BufferedReader.checkNotClosed
Code IndexAdd Tabnine to your IDE (free)

How to use
checkNotClosed
method
in
java.io.BufferedReader

Best Java code snippets using java.io.BufferedReader.checkNotClosed (Showing top 20 results out of 315)

origin: robovm/robovm

/**
 * Indicates whether this reader is ready to be read without blocking.
 *
 * @return {@code true} if this reader will not block when {@code read} is
 *         called, {@code false} if unknown or blocking will occur.
 * @throws IOException
 *             if this reader is closed or some other I/O error occurs.
 * @see #read()
 * @see #read(char[], int, int)
 * @see #readLine()
 */
@Override
public boolean ready() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    return ((end - pos) > 0) || in.ready();
  }
}
origin: robovm/robovm

/**
 * Resets this reader's position to the last {@code mark()} location.
 * Invocations of {@code read()} and {@code skip()} will occur from this new
 * location.
 *
 * @throws IOException
 *             if this reader is closed or no mark has been set.
 * @see #mark(int)
 * @see #markSupported()
 */
@Override
public void reset() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    if (mark == -1) {
      throw new IOException("Invalid mark");
    }
    this.pos = mark;
    this.lastWasCR = this.markedLastWasCR;
  }
}
origin: robovm/robovm

/**
 * Sets a mark position in this reader. The parameter {@code markLimit}
 * indicates how many characters can be read before the mark is invalidated.
 * Calling {@code reset()} will reposition the reader back to the marked
 * position if {@code markLimit} has not been surpassed.
 *
 * @param markLimit
 *            the number of characters that can be read before the mark is
 *            invalidated.
 * @throws IllegalArgumentException
 *             if {@code markLimit < 0}.
 * @throws IOException
 *             if an error occurs while setting a mark in this reader.
 * @see #markSupported()
 * @see #reset()
 */
@Override
public void mark(int markLimit) throws IOException {
  if (markLimit < 0) {
    throw new IllegalArgumentException("markLimit < 0:" + markLimit);
  }
  synchronized (lock) {
    checkNotClosed();
    this.markLimit = markLimit;
    this.mark = pos;
    this.markedLastWasCR = lastWasCR;
  }
}
origin: robovm/robovm

checkNotClosed();
if (end - pos >= charCount) {
  pos += charCount;
origin: robovm/robovm

checkNotClosed();
origin: robovm/robovm

/**
 * Reads a single character from this reader and returns it with the two
 * higher-order bytes set to 0. If possible, BufferedReader returns a
 * character from the buffer. If there are no characters available in the
 * buffer, it fills the buffer and then returns a character. It returns -1
 * if there are no more characters in the source reader.
 *
 * @return the character read or -1 if the end of the source reader has been
 *         reached.
 * @throws IOException
 *             if this reader is closed or some other I/O error occurs.
 */
@Override
public int read() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    int ch = readChar();
    if (lastWasCR && ch == '\n') {
      ch = readChar();
    }
    lastWasCR = false;
    return ch;
  }
}
origin: robovm/robovm

public int read(char[] buffer, int offset, int length) throws IOException {
  synchronized (lock) {
    checkNotClosed();
    Arrays.checkOffsetAndCount(buffer.length, offset, length);
    if (length == 0) {
origin: MobiVM/robovm

/**
 * Indicates whether this reader is ready to be read without blocking.
 *
 * @return {@code true} if this reader will not block when {@code read} is
 *         called, {@code false} if unknown or blocking will occur.
 * @throws IOException
 *             if this reader is closed or some other I/O error occurs.
 * @see #read()
 * @see #read(char[], int, int)
 * @see #readLine()
 */
@Override
public boolean ready() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    return ((end - pos) > 0) || in.ready();
  }
}
origin: ibinti/bugvm

/**
 * Indicates whether this reader is ready to be read without blocking.
 *
 * @return {@code true} if this reader will not block when {@code read} is
 *         called, {@code false} if unknown or blocking will occur.
 * @throws IOException
 *             if this reader is closed or some other I/O error occurs.
 * @see #read()
 * @see #read(char[], int, int)
 * @see #readLine()
 */
@Override
public boolean ready() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    return ((end - pos) > 0) || in.ready();
  }
}
origin: com.gluonhq/robovm-rt

/**
 * Indicates whether this reader is ready to be read without blocking.
 *
 * @return {@code true} if this reader will not block when {@code read} is
 *         called, {@code false} if unknown or blocking will occur.
 * @throws IOException
 *             if this reader is closed or some other I/O error occurs.
 * @see #read()
 * @see #read(char[], int, int)
 * @see #readLine()
 */
@Override
public boolean ready() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    return ((end - pos) > 0) || in.ready();
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Indicates whether this reader is ready to be read without blocking.
 *
 * @return {@code true} if this reader will not block when {@code read} is
 *         called, {@code false} if unknown or blocking will occur.
 * @throws IOException
 *             if this reader is closed or some other I/O error occurs.
 * @see #read()
 * @see #read(char[], int, int)
 * @see #readLine()
 */
@Override
public boolean ready() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    return ((end - pos) > 0) || in.ready();
  }
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Indicates whether this reader is ready to be read without blocking.
 *
 * @return {@code true} if this reader will not block when {@code read} is
 *         called, {@code false} if unknown or blocking will occur.
 * @throws IOException
 *             if this reader is closed or some other I/O error occurs.
 * @see #read()
 * @see #read(char[], int, int)
 * @see #readLine()
 */
@Override
public boolean ready() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    return ((end - pos) > 0) || in.ready();
  }
}
origin: com.jtransc/jtransc-rt

/**
 * Indicates whether this reader is ready to be read without blocking.
 *
 * @return {@code true} if this reader will not block when {@code read} is
 *         called, {@code false} if unknown or blocking will occur.
 * @throws IOException
 *             if this reader is closed or some other I/O error occurs.
 * @see #read()
 * @see #read(char[], int, int)
 * @see #readLine()
 */
@Override
public boolean ready() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    return ((end - pos) > 0) || in.ready();
  }
}
origin: FlexoVM/flexovm

/**
 * Indicates whether this reader is ready to be read without blocking.
 *
 * @return {@code true} if this reader will not block when {@code read} is
 *         called, {@code false} if unknown or blocking will occur.
 * @throws IOException
 *             if this reader is closed or some other I/O error occurs.
 * @see #read()
 * @see #read(char[], int, int)
 * @see #readLine()
 */
@Override
public boolean ready() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    return ((end - pos) > 0) || in.ready();
  }
}
origin: ibinti/bugvm

/**
 * Resets this reader's position to the last {@code mark()} location.
 * Invocations of {@code read()} and {@code skip()} will occur from this new
 * location.
 *
 * @throws IOException
 *             if this reader is closed or no mark has been set.
 * @see #mark(int)
 * @see #markSupported()
 */
@Override
public void reset() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    if (mark == -1) {
      throw new IOException("Invalid mark");
    }
    this.pos = mark;
    this.lastWasCR = this.markedLastWasCR;
  }
}
origin: MobiVM/robovm

/**
 * Resets this reader's position to the last {@code mark()} location.
 * Invocations of {@code read()} and {@code skip()} will occur from this new
 * location.
 *
 * @throws IOException
 *             if this reader is closed or no mark has been set.
 * @see #mark(int)
 * @see #markSupported()
 */
@Override
public void reset() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    if (mark == -1) {
      throw new IOException("Invalid mark");
    }
    this.pos = mark;
    this.lastWasCR = this.markedLastWasCR;
  }
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Resets this reader's position to the last {@code mark()} location.
 * Invocations of {@code read()} and {@code skip()} will occur from this new
 * location.
 *
 * @throws IOException
 *             if this reader is closed or no mark has been set.
 * @see #mark(int)
 * @see #markSupported()
 */
@Override
public void reset() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    if (mark == -1) {
      throw new IOException("Invalid mark");
    }
    this.pos = mark;
    this.lastWasCR = this.markedLastWasCR;
  }
}
origin: com.jtransc/jtransc-rt

/**
 * Resets this reader's position to the last {@code mark()} location.
 * Invocations of {@code read()} and {@code skip()} will occur from this new
 * location.
 *
 * @throws IOException
 *             if this reader is closed or no mark has been set.
 * @see #mark(int)
 * @see #markSupported()
 */
@Override
public void reset() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    if (mark == -1) {
      throw new IOException("Invalid mark");
    }
    this.pos = mark;
    this.lastWasCR = this.markedLastWasCR;
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Resets this reader's position to the last {@code mark()} location.
 * Invocations of {@code read()} and {@code skip()} will occur from this new
 * location.
 *
 * @throws IOException
 *             if this reader is closed or no mark has been set.
 * @see #mark(int)
 * @see #markSupported()
 */
@Override
public void reset() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    if (mark == -1) {
      throw new IOException("Invalid mark");
    }
    this.pos = mark;
    this.lastWasCR = this.markedLastWasCR;
  }
}
origin: com.gluonhq/robovm-rt

/**
 * Resets this reader's position to the last {@code mark()} location.
 * Invocations of {@code read()} and {@code skip()} will occur from this new
 * location.
 *
 * @throws IOException
 *             if this reader is closed or no mark has been set.
 * @see #mark(int)
 * @see #markSupported()
 */
@Override
public void reset() throws IOException {
  synchronized (lock) {
    checkNotClosed();
    if (mark == -1) {
      throw new IOException("Invalid mark");
    }
    this.pos = mark;
    this.lastWasCR = this.markedLastWasCR;
  }
}
java.ioBufferedReadercheckNotClosed

Popular methods of BufferedReader

  • <init>
    Creates a buffering character-input stream that uses an input buffer of the specified size.
  • readLine
    Reads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carr
  • close
    Closes this reader. This implementation closes the buffered source reader and releases the buffer. N
  • read
    Reads characters into a portion of an array. This method implements the general contract of the corr
  • lines
  • ready
    Tells whether this stream is ready to be read. A buffered character stream is ready if the buffer is
  • reset
    Resets the stream to the most recent mark.
  • mark
    Marks the present position in the stream. Subsequent calls to reset() will attempt to reposition the
  • skip
    Skips characters.
  • markSupported
    Tells whether this stream supports the mark() operation, which it does.
  • chompNewline
    Peeks at the next input character, refilling the buffer if necessary. If this character is a newline
  • fillBuf
    Populates the buffer with data. It is an error to call this method when the buffer still contains da
  • chompNewline,
  • fillBuf,
  • isClosed,
  • maybeSwallowLF,
  • readChar,
  • fill,
  • ensureOpen,
  • read1

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now