org.openbp.common.net
Class ByteArrayURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by org.openbp.common.net.ByteArrayURLConnection

public class ByteArrayURLConnection
extends java.net.URLConnection

To be used for URLs that refer to byte arrays in memory.

Author:
Stephan Pauxberger

Field Summary
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
ByteArrayURLConnection(java.net.URL url, byte[] bytes)
          Constructor.
 
Method Summary
 void connect()
           
 java.lang.Object getContent()
           
 int getContentLength()
           
 java.lang.String getContentType()
           
 java.io.InputStream getInputStream()
           
 java.io.OutputStream getOutputStream()
           
 java.lang.String toString()
           
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContentEncoding, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteArrayURLConnection

public ByteArrayURLConnection(java.net.URL url,
                              byte[] bytes)
Constructor.

Parameters:
url - Url
bytes - Byte array
Method Detail

connect

public void connect()
Specified by:
connect in class java.net.URLConnection

getContentLength

public int getContentLength()
Overrides:
getContentLength in class java.net.URLConnection

getContentType

public java.lang.String getContentType()
Overrides:
getContentType in class java.net.URLConnection

getContent

public java.lang.Object getContent()
                            throws java.io.IOException
Overrides:
getContent in class java.net.URLConnection
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Overrides:
getInputStream in class java.net.URLConnection
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Overrides:
getOutputStream in class java.net.URLConnection
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.net.URLConnection


Copyright © 2011. All Rights Reserved.