Permalink
Browse files

Deleted some unreferenced classes

  • Loading branch information...
1 parent 235887f commit b6d6c572f2ab1bcd82d3100278b2c0cbe134be8c Martin Kleppmann committed Feb 28, 2009
@@ -1,131 +0,0 @@
-/*
- * Copyright 2005--2008 Helsinki Institute for Information Technology
- *
- * This file is a part of Fuego middleware. Fuego middleware is free software; you can redistribute
- * it and/or modify it under the terms of the MIT license, included as the file MIT-LICENSE in the
- * Fuego middleware source distribution. If you did not receive the MIT license with the
- * distribution, write to the Fuego Core project at fc-util-users@hoslab.cs.helsinki.fi.
- */
-
-package fc.util;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Read-only map with un-listable keys. Any attempts to modify the map, or list the keys (or
- * corresponding values) will result in an {@link java.lang.UnsupportedOperationException}. On the
- * bright side, it allows you to easily implement an efficient lookup table by only overriding one
- * method ({@link #lookup(String)}).
- * @author Tancred Lindholm
- */
-
-public abstract class AbstractDictionary implements Map<String, String> {
-
- public AbstractDictionary() {
-
- }
-
-
- protected abstract String lookup(String key);
-
-
- /**
- * Not supported.
- */
-
- public void clear() {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Not supported.
- */
-
- public String put(String key, String value) {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Not supported.
- */
-
- public void putAll(Map<? extends String, ? extends String> m) {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Not supported.
- */
-
- public String remove(Object key) {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Not supported.
- */
-
- public int size() {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Not supported.
- */
-
- public boolean isEmpty() {
- throw new UnsupportedOperationException();
- }
-
-
- public boolean containsKey(Object key) {
- return key instanceof String && lookup((String) key) != null;
- }
-
-
- /**
- * Not supported.
- */
- public boolean containsValue(Object value) {
- throw new UnsupportedOperationException();
- }
-
-
- public String get(Object key) {
- return key instanceof String ? lookup((String) key) : null;
- }
-
-
- /**
- * Not supported.
- */
-
- public Set<String> keySet() {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Not supported.
- */
- public Collection<String> values() {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Not supported.
- */
- public Set<Entry<String, String>> entrySet() {
- throw new UnsupportedOperationException();
- }
-
-}
-// arch-tag: 5c283bab-3129-47df-b837-cd71081b211e
View
@@ -1,157 +0,0 @@
-/*
- * Copyright 2005--2008 Helsinki Institute for Information Technology
- *
- * This file is a part of Fuego middleware. Fuego middleware is free software; you can redistribute
- * it and/or modify it under the terms of the MIT license, included as the file MIT-LICENSE in the
- * Fuego middleware source distribution. If you did not receive the MIT license with the
- * distribution, write to the Fuego Core project at fc-util-users@hoslab.cs.helsinki.fi.
- */
-
-package fc.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * @author Jaakko Kangasharju
- */
-public class BinaryData {
-
- private BinaryData() {
-
- }
-
-
- public static long readNumber(InputStream in) throws IOException {
- return readNumber(in, in.read());
- }
-
-
- public static long readNumber(InputStream in, int first) throws IOException {
- if (first == 0) { return 0; }
- long value = first & 0x7F;
- int i = 7;
- while ((first & 0x80) != 0) {
- first = in.read();
- value |= (((long) (first & 0x7F)) << i);
- i += 7;
- }
- return value;
- }
-
-
- public static long readNumber(byte[] b, int off, int len) {
- if (b == null) { throw new NullPointerException("Received null byte array"); }
- if (off < 0 || off >= b.length) { throw new IllegalArgumentException("Invalid offset " +
- off + " not in [0," +
- b.length + ")"); }
- if (len < 0 || off + len > b.length) { throw new IllegalArgumentException(
- "Invalid length " +
- len +
- " not in [0," +
- (b.length - off) +
- "]"); }
- int l = len;
- int o = off;
- long result = 0;
- int i = 0;
- while (l > 0) {
- byte value = b[o];
- result |= (((long) (value & 0x7F)) << i);
- i += 7;
- o += 1;
- l -= 1;
- if ((value & 0x80) == 0) {
- break;
- }
- }
- if (l == 0 && (b[o - 1] & 0x80) != 0) { throw new IllegalArgumentException(
- "Array " +
- Util.toPrintable(
- b,
- off,
- len) +
- " does not start with a valid number"); }
- return result;
- }
-
-
- public static int numberLength(byte[] b, int off, int len) {
- if (b == null) { throw new NullPointerException("Received null byte array"); }
- if (off < 0 || off >= b.length) { throw new IllegalArgumentException("Invalid offset " +
- off + " not in [0," +
- b.length + ")"); }
- if (len < 0 || off + len > b.length) { throw new IllegalArgumentException(
- "Invalid length " +
- len +
- " not in [0," +
- (b.length - off) +
- "]"); }
- int result = 0;
- int o = off;
- int l = len;
- do {
- result += 1;
- o += 1;
- l -= 1;
- } while (l > 0 && (b[o - 1] & 0x80) != 0);
- if (l == 0 && (b[o - 1] & 0x80) != 0) { throw new IllegalArgumentException(
- "Array " +
- Util.toPrintable(
- b,
- off,
- len) +
- " does not contain a complete number"); }
- return result;
- }
-
-
- public static String readString(InputStream in) throws IOException {
- return readString(in, in.read());
- }
-
-
- private static String readString(InputStream in, int first) throws IOException {
- int len = (int) readNumber(in, first);
- byte[] bytes = new byte[len];
- int offset = 0;
- while (len > 0) {
- int n = in.read(bytes, offset, len);
- if (n < 0) { throw new IOException("Premature end of stream, expected to read " + len +
- " more bytes"); }
- offset += n;
- len -= n;
- }
- return new String(bytes, "US-ASCII");
- }
-
-
- public static void writeNumber(long value, OutputStream out) throws IOException {
- if (value == 0) {
- out.write(0x00);
- } else if (value > 0) {
- do {
- long next = value >>> 7;
- int b = (int) (value & 0x7F);
- if (next > 0) {
- b |= 0x80;
- }
- out.write(b);
- value = next;
- } while (value > 0);
- } else {
- throw new IOException("Negative value " + value + " not supported");
- }
- }
-
-
- public static void writeString(String value, OutputStream out) throws IOException {
- byte[] bytes = value.getBytes("US-ASCII");
- writeNumber(bytes.length, out);
- out.write(bytes);
- }
-
-}
-
-// arch-tag: 84eb2a30-fd05-4522-8f3b-378f9abeaf43
@@ -1,27 +0,0 @@
-/*
- * Copyright 2005--2008 Helsinki Institute for Information Technology
- *
- * This file is a part of Fuego middleware. Fuego middleware is free software; you can redistribute
- * it and/or modify it under the terms of the MIT license, included as the file MIT-LICENSE in the
- * Fuego middleware source distribution. If you did not receive the MIT license with the
- * distribution, write to the Fuego Core project at fc-util-users@hoslab.cs.helsinki.fi.
- */
-
-package fc.util;
-
-import java.io.OutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-/**
- * @author Jaakko Kangasharju
- */
-public class ByteArrayStream extends ByteArrayOutputStream {
-
- public void writeContents(OutputStream out) throws IOException {
- out.write(buf, 0, count);
- }
-
-}
-
-// arch-tag: f3fab20f-8ab4-420a-98b6-a3989c6f60a6
Oops, something went wrong.

0 comments on commit b6d6c57

Please sign in to comment.