Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
public static final byte[] TERMINATING_BYTES = new byte[] { -100, -100, -100, -100, -100, -100 }; public static final String SERVER_NAME = "http://192.168.1.4:8080/GeocastServer/ShareablePostingServlet"; private String session; @Override public List getShareables(Location myLocation) throws Exception { URL url = new URL(SERVER_NAME); List retval = new ArrayList(); URLConnection urlConnection = url.openConnection(); if (session != null) { urlConnection.setRequestProperty("cookie", session); } ByteArrayOutputStream bos = new ByteArrayOutputStream(); InputStream inputStream = urlConnection.getInputStream(); String cookie = urlConnection.getHeaderField("Set-Cookie"); if (cookie != null) { session = cookie.substring(0, cookie.indexOf(";")); } int temp; byte[] lastXbytes = new byte[TERMINATING_BYTES.length]; int currentPosition = 0; int beginingOfThisShareableIndex = 0; while ((temp = inputStream.read()) != -1) { bos.write(temp); lastXbytes[currentPosition % lastXbytes.length] = (byte) temp; if (currentPosition == 261) { System.out.println(); } if (lastXbytes.length == TERMINATING_BYTES.length && Arrays.equals(lastXbytes, TERMINATING_BYTES)) { byte[] forThisShareable = new byte[currentPosition - TERMINATING_BYTES.length - beginingOfThisShareableIndex]; System.arraycopy(bos.toByteArray(), beginingOfThisShareableIndex, forThisShareable, 0, forThisShareable.length); Shareable shareable = Shareable.readFromBytes(forThisShareable); retval.add(shareable); beginingOfThisShareableIndex = currentPosition; } currentPosition++; } return retval; } @Override public void uploadShareable(Shareable shareable) throws Exception { URL url = new URL(SERVER_NAME); URLConnection conn = url.openConnection(); conn.setDoOutput(true); OutputStream wr = conn.getOutputStream(); wr.write(shareable.getBytes()); wr.flush(); conn.getInputStream(); } @Override public byte[] getShareableContent(long shareableId) throws Exception { URL url = new URL(SERVER_NAME + "?shareableId=" + shareableId); ByteArrayOutputStream bos = new ByteArrayOutputStream(); InputStream inputStream = url.openStream(); int temp; while ((temp = inputStream.read()) != -1) { bos.write(temp); } return bos.toByteArray(); }