Batching preprocessor that will briefly delay the sending of a message
if it doesn't fill up a full tunnel message, in which case it queues up
an additional flush task.
Gets the next indicator and returns either null when the stream
has ended or bdecodes the rest of the stream and returns the
appropriate BEValue encoded object.
Java 1.5 PipedInputStream buffers are only 1024 bytes; our I2CP messages are typically 1730 bytes,
thus causing thread blockage before the whole message is transferred.
On-disk format:
Magic number (6 bytes)
Version major/minor (2 bytes)
file length (long)
free list start (unsigned int)
is mounted (unsigned short) 0 = no, 1 = yes
span size (unsigned short)
block size (unsigned int)
Metaindex skiplist is on page 2
Pages are 1 KB and are numbered starting from 1.
This is run in a thread from a limited-size thread pool via Handler.run(),
except for a standard server (this class, no extension, as determined in getUsePool()),
it is run directly in the acceptor thread (see run()).
Non-recursive initializer initializeLevels()
MUST be called on the first BSkipLevel in the skiplist
after the constructor, unless it's a new empty
level and init() was previously called.
Handle the received tunnel build message requests and replies,
including sending responsses to requests, updating the
lists of our tunnels and participating tunnels,
and updating stats.
Receive the build message at a certain hop, decrypt its encrypted record,
read the enclosed tunnel request, decide how to reply, write the reply,
encrypt the reply record, and return a TunnelBuildMessage to forward on to
the next hop
Decrypt the data from the specified record, writing the decrypted record into this instance's
data buffer
Caller MUST check that first 16 bytes of our hash matches first 16 bytes of encryptedRecord
before calling this.
alreadyTransferred - total of all attempts, not including currentWrite
If nonzero on the first call, a partial file of that length was found,
_and_ the server supports resume.