Example usage for org.apache.commons.net.tftp TFTP DEFAULT_PORT

List of usage examples for org.apache.commons.net.tftp TFTP DEFAULT_PORT

Introduction

In this page you can find the example usage for org.apache.commons.net.tftp TFTP DEFAULT_PORT.

Prototype

int DEFAULT_PORT

To view the source code for org.apache.commons.net.tftp TFTP DEFAULT_PORT.

Click Source Link

Document

The default TFTP port according to RFC 783 is 69.

Usage

From source file:jsaf.protocol.tftp.TftpURLStreamHandler.java

@Override
public int getDefaultPort() {
    return TFTP.DEFAULT_PORT;
}

From source file:jsaf.protocol.tftp.TftpURLConnection.java

public void connect() throws IOException {
    host = InetAddress.getByName(url.getHost());
    if (url.getPort() == -1) {
        port = TFTP.DEFAULT_PORT;
    } else {// w ww . jav a  2 s.c  o  m
        port = url.getPort();
    }
    client.open();
    connected = true;
}

From source file:org.jnode.protocol.tftp.TFTPURLConnection.java

/**
 * @see java.net.URLConnection#getInputStream()
 *//*from  ww  w  .  j a va  2s  .  c  om*/
public InputStream getInputStream() throws IOException {
    final ByteArrayOutputStream os = new ByteArrayOutputStream();
    final TFTPClient tftp = new TFTPClient();
    final InetAddress hostAddr = InetAddress.getByName(host);
    tftp.open(TFTP.DEFAULT_PORT);
    try {
        tftp.receiveFile(path, TFTP.BINARY_MODE, os, hostAddr);
    } finally {
        tftp.close();
    }
    return new ByteArrayInputStream(os.toByteArray());
}