private void testPatch(Patch patch) throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(out, Charsets.UTF_8); PatchSerializer.write(writer, patch); ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); Patch serializedPatch = PatchSerializer.read(reader); assertEquals(patch, serializedPatch); }
private void testPatch(Patch patch) throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(out, Charsets.UTF_8); PatchSerializer.write(writer, patch); ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); Patch serializedPatch = PatchSerializer.read(reader); assertEquals(patch, serializedPatch); }
throw new IllegalStateException("Error reading patch file " + patchFile, e); Patch patch = PatchSerializer.read(reader); Closeables.closeQuietly(reader); Closeables.closeQuietly(stream);
throw new IllegalStateException("Error reading patch file " + patchFile, e); Patch patch = PatchSerializer.read(reader); Closeables.closeQuietly(reader); Closeables.closeQuietly(stream);
throw new IllegalStateException("Error reading patch file " + patchFile, e); Patch patch = PatchSerializer.read(reader); Closeables.closeQuietly(reader); Closeables.closeQuietly(stream);
throw new CommandFailedException("Error reading patch file " + patchFile, e); Patch patch = PatchSerializer.read(reader); Closeables.closeQuietly(reader); Closeables.closeQuietly(stream);
throw new CommandFailedException("Error reading patch file " + patchFile, e); Patch patch = PatchSerializer.read(reader); Closeables.closeQuietly(reader); Closeables.closeQuietly(stream);
throw new CommandFailedException("Error reading patch file " + patchFile, e); Patch patch = PatchSerializer.read(reader); Closeables.closeQuietly(reader); Closeables.closeQuietly(stream);