Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/robaho/net/httpserver/ActivityTimer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Locale;
import java.util.TimerTask;

class ActivityTimer {
final class ActivityTimer {
private static volatile long now = System.currentTimeMillis();
private static volatile String dateAndTime = formatDate();

Expand Down Expand Up @@ -39,14 +39,14 @@ private static String formatDate() {
return sb.toString();
}

public static long now() {
static long now() {
return now;
}
/**
* return the formatted current date and time suitable for use with the Date http header. this
* is OK to cache since the resolution is only seconds, and we will update more often than that
*/
public static String dateAndTime() {
static String dateAndTime() {
return dateAndTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ private void fill() throws IOException {
* or an I/O error occurs.
* @see java.io.FilterInputStream#in
*/
@Override
public int read() throws IOException {
if (pos >= count) {
fill();
Expand Down Expand Up @@ -167,6 +168,7 @@ private int read1(byte[] b, int off, int len) throws IOException {
* or an I/O error occurs.
* @throws IndexOutOfBoundsException {@inheritDoc}
*/
@Override
public int read(byte[] b, int off, int len) throws IOException {
ensureOpen();
if ((off | len | (off + len) | (b.length - (off + len))) < 0) {
Expand Down Expand Up @@ -199,6 +201,7 @@ public int read(byte[] b, int off, int len) throws IOException {
* {@code in.skip(n)} throws an IOException,
* or an I/O error occurs.
*/
@Override
public long skip(long n) throws IOException {
ensureOpen();
if (n <= 0) {
Expand Down Expand Up @@ -229,6 +232,7 @@ public long skip(long n) throws IOException {
* invoking its {@link #close()} method,
* or an I/O error occurs.
*/
@Override
public int available() throws IOException {
if (in == null)
throw new IOException("Stream closed");
Expand All @@ -248,6 +252,7 @@ public int available() throws IOException {
*
* @throws IOException if an I/O error occurs.
*/
@Override
public void close() throws IOException {
if(buf!=null) {
buf = null;
Expand Down