Tabnine Logo
LineAppender.flush
Code IndexAdd Tabnine to your IDE (free)

How to use
flush
method
in
org.apache.sis.io.LineAppender

Best Java code snippets using org.apache.sis.io.LineAppender.flush (Showing top 3 results out of 315)

origin: org.apache.sis.core/sis-utility

  writer.flush();
} catch (IOException e) {
  throw new AssertionError(e);
origin: apache/sis

  writer.flush();
} catch (IOException e) {
  throw new UncheckedIOException(e);
origin: apache/sis

  /**
   * Tests a call to {@link LineAppender#flush()} interleaved between two lines,
   * where the second line begin with a tabulation.
   *
   * @throws IOException should never happen, since we are writing in a {@link StringBuilder}.
   *
   * @see <a href="https://issues.apache.org/jira/browse/SIS-140">SIS-140</a>
   */
  @Test
  public void testInterleavedFlush() throws IOException {
    final LineAppender f = (LineAppender) appender;
    f.setTabulationWidth(4);
    f.append("S1");
    f.flush();
    f.append("\tS2");
    assertOutputEquals(f.isTabulationExpanded() ? "S1  S2" : "S1\tS2");
  }
}
org.apache.sis.ioLineAppenderflush

Javadoc

Sends all pending characters to the underlying appendable, including trailing whitespaces. Note that this method should preferably be invoked at the end of a word, sentence or line, since invoking this method may prevent LineAppender to properly wrap the current line if the current position is in the middle of a word.

Invoking this method also flushes the underlying stream, if Flushable. A cheaper way to send pending characters is to make sure that the last character is a Characters#isLineOrParagraphSeparator(int), or to invoke #clear().

Popular methods of LineAppender

  • <init>
    Constructs a formatter which will replaces line separators by the given string.
  • append
    Writes a portion of a character sequence.
  • getLineSeparator
    Returns the line separator to be sent to the underlying appendable, or null if EOL sequences are for
  • setTabulationWidth
    Sets the tabulation width, in unit of Unicode characters (code point count).
  • getTabulationWidth
    Returns the current tabulation width, in unit of Unicode characters (code point count). The default
  • setLineSeparator
    Changes the line separator to be sent to the underlying appendable. This is the string to insert in
  • appendCodePoint
  • appendSurrogate
  • deleteSoftHyphen
    Removes the soft hyphen characters from the given buffer. This is invoked when the buffer is about t
  • endOfLine
    Writes pending non-white characters, discards trailing whitespaces, and resets column position to ze
  • getMaximalLineLength
    Returns the maximal line length, in unit of Unicode characters (code point count). The default value
  • isTabulationExpanded
    Returns true if this formatter expands tabulations into spaces. The default value is false, which me
  • getMaximalLineLength,
  • isTabulationExpanded,
  • lineSeparator,
  • onLineBegin,
  • setTabulationExpanded,
  • toCodePoint,
  • transfer,
  • write,
  • writeLineSeparator

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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