Interface ChunkWriter.WriteCallback

Enclosing class:
ChunkWriter
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ChunkWriter.WriteCallback
Interface used to perform the uninterruptable writes when the buffer fills up.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    write​(ByteBuffer buffer, long position)
    Performs an uninterruptable write of the given bytes to the given file position.
  • Method Details

    • write

      boolean write(ByteBuffer buffer, long position) throws IOException
      Performs an uninterruptable write of the given bytes to the given file position.
      Parameters:
      buffer - the bytes to write
      position - the file position to write them to
      Returns:
      true iff an attempt was made to interrupt the write via Thread.interrupt(). Note that the write must succeed regardless of the return value.
      Throws:
      IOException - if unable to perform the write