Package io.sentry.instrumentation.file
Class SentryFileOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FileOutputStream
-
- io.sentry.instrumentation.file.SentryFileOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public final class SentryFileOutputStream extends java.io.FileOutputStream
An implementation ofFileOutputStream
that creates aISpan
for writing operation with filename and byte count set as descriptionNote, that span is started when this OutputStream is instantiated via constructor and finishes when the
FileOutputStream.close()
is called.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SentryFileOutputStream.Factory
-
Constructor Summary
Constructors Constructor Description SentryFileOutputStream(@NotNull java.io.FileDescriptor fdObj)
SentryFileOutputStream(@Nullable java.io.File file)
SentryFileOutputStream(@Nullable java.io.File file, boolean append)
SentryFileOutputStream(@Nullable java.lang.String name)
SentryFileOutputStream(@Nullable java.lang.String name, boolean append)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
write(byte @NotNull [] b)
void
write(byte @NotNull [] b, int off, int len)
void
write(int b)
-
-
-
Constructor Detail
-
SentryFileOutputStream
public SentryFileOutputStream(@Nullable @Nullable java.lang.String name) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
SentryFileOutputStream
public SentryFileOutputStream(@Nullable @Nullable java.lang.String name, boolean append) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
SentryFileOutputStream
public SentryFileOutputStream(@Nullable @Nullable java.io.File file) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
SentryFileOutputStream
public SentryFileOutputStream(@Nullable @Nullable java.io.File file, boolean append) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
SentryFileOutputStream
public SentryFileOutputStream(@NotNull @NotNull java.io.FileDescriptor fdObj)
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException
- Overrides:
write
in classjava.io.FileOutputStream
- Throws:
java.io.IOException
-
write
public void write(byte @NotNull [] b) throws java.io.IOException
- Overrides:
write
in classjava.io.FileOutputStream
- Throws:
java.io.IOException
-
write
public void write(byte @NotNull [] b, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.FileOutputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.FileOutputStream
- Throws:
java.io.IOException
-
-