@Override public RawMap build(WMSMapContent mapContent) throws IOException { byte[] contents = encoder.encode(); return new RawMap(mapContent, contents, MIME_TYPE); }
@Override public RawMap build(WMSMapContent mapContent) throws IOException { byte[] contents = encoder.encode(); return new RawMap(mapContent, contents, MIME_TYPE); } }
@Override public RawMap build(WMSMapContent mapContent) throws IOException { jsonWriter.endArray(); // end features jsonWriter.endObject();// end root object writer.flush(); writer.close(); out.close(); long length; RawMap map; if (out.isInMemory()) { byte[] data = out.getData(); length = data.length; map = new RawMap(mapContent, data, MIME_TYPE); } else { File f = out.getFile(); length = f.length(); map = new DeferredFileOutputStreamWebMap(mapContent, out, MIME_TYPE); } map.setResponseHeader("Content-Length", String.valueOf(length)); return map; } }
byte[] data = out.getData(); length = data.length; map = new RawMap(mapContent, data, MIME_TYPE); } else { File f = out.getFile();
@Override public RawMap build(WMSMapContent mapContent) throws IOException { jsonWriter.endArray(); // end features jsonWriter.endObject(); // end root object writer.flush(); writer.close(); out.close(); long length; RawMap map; if (out.isInMemory()) { byte[] data = out.getData(); length = data.length; map = new RawMap(mapContent, data, MIME_TYPE); } else { File f = out.getFile(); length = f.length(); map = new DeferredFileOutputStreamWebMap(mapContent, out, MIME_TYPE); } map.setResponseHeader("Content-Length", String.valueOf(length)); return map; } }
byte[] data = out.getData(); length = data.length; map = new RawMap(mapContent, data, MIME_TYPE); } else { File f = out.getFile();
ByteArrayOutputStream buff = new ByteArrayOutputStream(); template.process(map, new OutputStreamWriter(buff, Charset.forName("UTF-8"))); RawMap result = new RawMap(mapContent, buff, getMimeType()); return result; } catch (TemplateException e) {
final String mimeType = cachedTile.getMimeType().getMimeType(); RawMap map = new RawMap(null, tileBytes, mimeType);
final String mimeType = cachedTile.getMimeType().getMimeType(); RawMap map = new RawMap(null, tileBytes, mimeType);
@Test public void testInputStream() throws Exception { InputStream stream = createMock(InputStream.class); expect(stream.read((byte[]) anyObject())).andReturn(-1).once(); replay(stream); WMSMapContent map = createNiceMock(WMSMapContent.class); replay(map); new RawMap(map, stream, "text/plain").writeTo(null); verify(stream); } }