net.i2p.util

## Class PartialEepGet

- java.lang.Object
- - net.i2p.util.EepGet
  - - net.i2p.util.PartialEepGet

-     public class PartialEepGet
      extends EepGet

  Fetch exactly the first 'size' bytes into a stream Anything less or more will throw an IOException No retries, no min and max size options, no timeout option If the server does not return a Content-Length header of the correct size, the fetch will fail. Useful for checking .sud versions

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class net.i2p.util.EepGet

      `EepGet.AUTH_MODE, EepGet.AuthState, EepGet.CLIStatusListener, EepGet.Gunzipper, EepGet.StatusListener`

  - ### Field Summary

    - ### Fields inherited from class net.i2p.util.EepGet

      `_aborted, _acceptRanges, _actualURL, _alreadyTransferred, _authState, _bytesRemaining, _bytesTransferred, _cacheControl, _contentEncoding, _contentLanguage, _contentType, _context, _cookie, _csp, _currentAttempt, _decompressException, _encodingChunked, _etag, _etagOrig, _expiryDate, _extraHeaders, _fetchHeaderTimeout, _fetchInactivityTimeout, _fetchTotalTimeout, _isGzippedResponse, _keepFetching, _lastModified, _lastModifiedOrig, _listeners, _log, _notModified, _numRetries, _out, _outputFile, _outputStream, _proxy, _proxyHost, _proxyIn, _proxyOut, _proxyPort, _redirectLocation, _redirects, _referrerPolicy, _responseCode, _responseText, _server, _shouldProxy, _shouldWriteErrorToOutput, _status, _transferEncoding, _transferFailed, _url, _vary, _xContentTypeOptions, _xframeOptions, _xPoweredBy, _xssProtection, CONNECT_TIMEOUT, INACTIVITY_TIMEOUT, MAX_COMPLETE_FAILS, USER_AGENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PartialEepGet(I2PAppContext ctx, String proxyHost, int proxyPort, OutputStream outputStream, String url, long size)` Instantiate an EepGet that will fetch exactly size bytes when fetch() is called.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `getRequest()`
    `static void` | `main(String[] args)` PartialEepGet [-p 127.0.0.1:4444] [-l #bytes] url

    - ### Methods inherited from class net.i2p.util.EepGet

      `addAuthorization, addHeader, addStatusListener, doFetch, fetch, fetch, fetch, getAcceptRanges, getCacheControl, getContentEncoding, getContentLanguage, getContentType, getCookie, getCSP, getEtag, getExpiryDate, getLastModified, getNotModified, getReferrerPolicy, getServer, getStatus, getStatusCode, getStatusText, getTransferEncoding, getVary, getXContentTypeOptions, getXframeOptions, getXPoweredBy, getXSSProtection, parseAuthArgs, readChunkLength, readHeaders, sendRequest, setPostData, setPostData, setPostData, setWriteErrorToOutput, shouldReadBody, stopFetching, suggestName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PartialEepGet

          public PartialEepGet(I2PAppContext ctx,
                               String proxyHost,
                               int proxyPort,
                               OutputStream outputStream,
                               String url,
                               long size)

      Instantiate an EepGet that will fetch exactly size bytes when fetch() is called.
      Parameters:
        `proxyHost` - use null or "" for no proxy
        `proxyPort` - use 0 for no proxy
        `size` - fetch exactly this many bytes

  - ### Method Detail

    - #### getRequest

          protected String getRequest()
                               throws IOException

      Overrides:
        `getRequest` in class `EepGet`
      Throws:
        `IOException`

    - #### main

          public static void main(String[] args)

      PartialEepGet [-p 127.0.0.1:4444] [-l #bytes] url