Package org.ardverk.dht.rsrc

Examples of org.ardverk.dht.rsrc.ByteArrayValue


        xml.close();
      }
     
      return new Response(status)
        .setContentType(Constants.XML_TEXT_TYPE)
        .setValue(new ByteArrayValue(baos.toByteArray()));
     
    } catch (UnsupportedEncodingException err) {
      throw new IllegalStateException("UnsupportedEncodingException", err);
    } catch (XMLStreamException err) {
      throw new IllegalStateException("XMLStreamException", err);
View Full Code Here


   
    long contentLength = context.getContentLength();
    byte[] content = new byte[(int)contentLength];
    StreamUtils.readFully(in, content);
   
    return new Response(statusLine, context, new ByteArrayValue(content));
  }
View Full Code Here

        int len = -1;
        while ((len = in.read(buffer)) != -1) {
          baos.write(buffer, 0, len);
        }
       
        return new Handle(key, new ByteArrayValue(baos.toByteArray()));
      } finally {
        IoUtils.close(in);
      }
    }
View Full Code Here

    }
   
    // TODO: This is kinda wasteful but doing for now because it's easy.
    byte[] data = new byte[(int)length];
    StreamUtils.readFully(in, data);
    return new ByteArrayValue(data);
  }
View Full Code Here

TOP

Related Classes of org.ardverk.dht.rsrc.ByteArrayValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.