/** * Construct a new splash screen with the image that can be found at the * specified location. * * @param imageLocation * A reference to an image that can be loaded through the * ClassLoader, e.g. <tt>info/aduna/util/splash.gif</tt> */ public SplashScreen(String imageLocation) { this(ResourceUtil.getImage(imageLocation)); }
protected void closeActiveContext() throws IOException { if (inActiveContext) { writer.decreaseIndentation(); writer.write("}"); writer.writeEOL(); inActiveContext = false; currentContext = null; } }
/** * Writes an end-of-line character sequence and triggers the indentation for * the text written on the next line. */ public void writeEOL() throws IOException { write(LINE_SEPARATOR); indentationWritten = false; }
private void prepareForWire() throws Exception { if (file != null) { // set the data data = IOUtil.readBytes(file); } else if (stmts != null) { // set the data and content type (TRIG by default) format = RDFFormat.TRIG; data = serialize(stmts, format); } }
public static void writeBytes(byte[] data, OutputStream out) throws IOException { transfer(new ByteArrayInputStream(data), out); }
/** * Read properties from the specified file. * * @param propsFile * the file to read from * @return Properties loaded from the specified file * @throws IOException * when the file could not be read properly */ public static Properties readProperties(File propsFile) throws IOException { return readProperties(propsFile, null); }
public PreferencesAction(GraphPanel panel) { super("Preferences...", ResourceUtil.getImageIcon("info/aduna/clustermap/preferences.png")); putValue(Action.SHORT_DESCRIPTION, "View/Modify preferences"); this.panel = panel; }
/** * Checks whether there's more input to read. * * @exception IOException * If an I/O error occurred in the current Reader */ public boolean moreInput() throws IOException { int inBuf = fillLABuf(1); return (inBuf > 0); }
public byte readByte(long offset) throws IOException { return readBytes(offset, 1)[0]; }
/** * Creates a new PushbackReader. * * @param r * The first reader to be pushed back */ public PushbackReader(Reader r) { this(); pushback(r); }
public void writeByte(byte value, long offset) throws IOException { writeBytes(new byte[] { value }, offset); }
/** * Gets the subarray from <tt>array</tt> that starts at <tt>offset</tt>. */ public static byte[] get(byte[] array, int offset) { return get(array, offset, array.length - offset); }
/** * Loads the Maven <tt>pom.properties</tt> for the specified artifact. * * @param groupId * The artifact's group ID. * @param artifactId * The artifact's ID. * @return The parsed pom properties, or <tt>null</tt> if the resource could * not be found. */ public static Properties loadPomProperties(String groupId, String artifactId) throws IOException { String properties = "META-INF/maven/" + groupId + "/" + artifactId + "/pom.properties"; return ResourceUtil.getProperties(properties); }
public void writeInt(int value, long offset) throws IOException { ByteBuffer buf = ByteBuffer.allocate(4); buf.putInt(0, value); write(buf, offset); }
public int readInt(long offset) throws IOException { ByteBuffer buf = ByteBuffer.allocate(4); read(buf, offset); return buf.getInt(0); } }
protected void closePreviousStatement() throws IOException { if (!statementClosed) { // The previous statement still needs to be closed: writer.write(" ."); writer.writeEOL(); writer.decreaseIndentation(); statementClosed = true; lastWrittenSubject = null; lastWrittenPredicate = null; } }
/** * Read properties from the specified InputStream. * * @param in * the stream to read from. The stream will be closed by this method. * @return Properties loaded from the specified stream. The stream will be * closed by this method. * @throws IOException * when the stream could not be read properly */ public static Properties readProperties(InputStream in) throws IOException { return readProperties(in, null); }
/** * Get the character at the supplied lookAhead. charAt(0) returns the first * character to be read. * * @return the character at the supplied lookAhead, or -1 if the lookAhead * is after the last character in the stream. */ public int charAt(int lookAhead) throws IOException { // Fill buffer in necessary int inBuf = fillLABuf(lookAhead + 1); // Enough characters in buffer? if (lookAhead >= inBuf) { // Not that much characters in stream anymore return -1; } return laBuf[lookAhead]; }