Package httl.util

Examples of httl.util.UnsafeByteArrayInputStream


    public InputStream getResourceAsStream(final String name) {
      if (name.endsWith(ClassUtils.CLASS_EXTENSION)) {
        String qualifiedClassName = name.substring(0, name.length() - ClassUtils.CLASS_EXTENSION.length()).replace('/', '.');
        JavaFileObjectImpl file = (JavaFileObjectImpl) classes.get(qualifiedClassName);
        if (file != null) {
          return new UnsafeByteArrayInputStream(file.getByteCode());
        }
      }
      return super.getResourceAsStream(name);
    }
View Full Code Here


      return source;
    }

    @Override
    public InputStream openInputStream() {
      return new UnsafeByteArrayInputStream(getByteCode());
    }
View Full Code Here

  public <T> T valueOf(byte[] str, Class<T> type) throws ParseException {
    if (str == null) {
      return null;
    }
    if (type == null) {
      return (T) XSTREAM.fromXML(new UnsafeByteArrayInputStream(str));
    }
    try {
      return (T) XSTREAM.fromXML(new UnsafeByteArrayInputStream(str), type.newInstance());
    } catch (Exception e) {
      throw new RuntimeException(e.getMessage(), e);
    }
  }
View Full Code Here

TOP

Related Classes of httl.util.UnsafeByteArrayInputStream

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.