All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.unlaxer.compiler.MemoryJavaFileObjectForClass Maven / Gradle / Ivy

There is a newer version: 1.4.4
Show newest version
package org.unlaxer.compiler;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;

public class MemoryJavaFileObjectForClass extends CustomJavaFileObject{

  byte[] bytes;
  
  protected MemoryJavaFileObjectForClass(ClassName className , byte[] bytes) {
    super(className.fullName(), URI.create("string:///" + className.fullName() + ".class"));
    this.bytes = bytes;
  }
  @Override
  public InputStream openInputStream() throws IOException {
    return new ByteArrayInputStream(bytes);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy