public JSONArray requestMeta() throws IOException {
        if (socket == null) {
            throw new IllegalStateException("No open connection!");
        }

        logger.debug("Requesting meta file ");
        String message = ConnectionMessages.SERVER_META_DOWNLOAD;
        // Write message
        socket.getOutputStream().write(message.getBytes());
        socket.getOutputStream().flush();

        int response = socket.getInputStream().read();

        if (response == ConnectionMessages.SERVER_FILEPULL_SENDING) {
            logger.debug(" Getting meta file");

            // Get the total file size first
            byte[] buffer = new byte[8];
            socket.getInputStream().read(buffer);

            // TODO: Fix so we can read larger files..
            long filesize = Math.min(Utilities.bytesToLong(buffer), (long) Integer.MAX_VALUE);
            logger.debug(" Filesize: " + filesize);

            // Resize buffer
            buffer = new byte[BUFFER_SIZE];
            int length, readBytes;

            OutputStream stream = null;
            ByteArrayOutputStream baos = null;
            try {
                baos = new ByteArrayOutputStream((int) filesize);
                stream = new BufferedOutputStream(baos);

                // Loop till entire file received
                while (filesize > 0) {
                    length = (int) Math.min(filesize, (long) BUFFER_SIZE);

                    // Read/write the data
                    readBytes = socket.getInputStream().read(buffer, 0, length);

                    // Use the readBytes from hereon (this can differ!)
                    stream.write(buffer, 0, readBytes);
                    stream.flush();

                    filesize -= readBytes;
                }

                try {
                    JSONArray contentFile = (JSONArray) new JSONParser().parse(new String(baos.toByteArray()));
                    logger.debug(" File transfer complete!");
                    return contentFile;
                } catch (ParseException pe) {
                    logger.fatal("Could not decode the filemeta object!");
                    return null;
                }
            } finally {
                try {
                    if (stream != null)
                        stream.close();
                } catch (IOException ex) {
                }
                try {
                    if (baos != null)
                        baos.close();
                } catch (IOException ex) {
                }
            }
        } else {
            logger.error("Server gave an invalid response...!");
            return null;
        }
    }