/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2015, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
public class SimpleBinaryAttributeWritingStrategy extends SimpleAttributeWritingStrategy {
- /**
- * @param document
- * @param key
- */
public SimpleBinaryAttributeWritingStrategy(final Document document, final String key) {
super(document, key);
}
List<?> list = (List<?>) value;
byte[] decoded = new byte[list.size()];
- int i = 0;
- for (Object bAsStr : list) {
- Preconditions.checkArgument(bAsStr instanceof String, "Unexpected inner value for %s, expected string", value);
- byte b = Byte.parseByte((String) bAsStr);
- decoded[i++] = b;
+ int index = 0;
+ for (Object basStr : list) {
+ Preconditions.checkArgument(basStr instanceof String, "Unexpected inner value for %s, expected string",
+ value);
+ decoded[index++] = Byte.parseByte((String) basStr);
}
-
return en.encode(decoded);
}
-
}