org.jvnet.hudson.tftpd
Class Data

java.lang.Object
  extended by org.jvnet.hudson.tftpd.Data

public abstract class Data
extends java.lang.Object

Author:
Kohsuke Kawaguchi

Constructor Summary
Data()
           
 
Method Summary
static Data from(byte[] data)
          Creates a Data object around a byte array.
static Data from(java.lang.String data)
          Creates a Data object around a String.
static Data from(java.net.URL url)
          Creates a Data object from a URL.
abstract  java.io.InputStream read()
          Reads this data.
 int size()
          Computes the size of the data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Data

public Data()
Method Detail

read

public abstract java.io.InputStream read()
                                  throws java.io.IOException
Reads this data.

Throws:
java.io.IOException - If it turns out that this data doesn't exist, or failed to read.

size

public int size()
         throws java.io.IOException
Computes the size of the data.

The default implementation isn't very efficient.

Throws:
java.io.IOException

from

public static Data from(java.net.URL url)
Creates a Data object from a URL.


from

public static Data from(java.lang.String data)
Creates a Data object around a String.


from

public static Data from(byte[] data)
Creates a Data object around a byte array.



Copyright © 2009. All Rights Reserved.